diff --git a/Examples/MAX78000/CNN/cats-dogs_demo/README.md b/Examples/MAX78000/CNN/cats-dogs_demo/README.md index 53f90da75e9..ec48d18f844 100644 --- a/Examples/MAX78000/CNN/cats-dogs_demo/README.md +++ b/Examples/MAX78000/CNN/cats-dogs_demo/README.md @@ -5,7 +5,7 @@ Description ----------- -The model trained in this demo is used to classify images of cats and dogs. 25000 images dataset is used to train the model. The dataset can be downloaded using�[https://www.kaggle.com/c/dogs-vs-cats/data](https://www.kaggle.com/c/dogs-vs-cats/data)�link. The input size is 64x64 pixels RGB which is 3x64x64 in CHW format. +The model trained in this demo is used to classify images of cats and dogs. 25000 images dataset is used to train the model. The dataset can be downloaded using�[https://www.kaggle.com/c/dogs-vs-cats/data](https://www.kaggle.com/c/dogs-vs-cats/data)�link. The input size is 128x128 pixels RGB which is 3x128x128 in CHW format. The code uses a sampledata header (sampledata.h) file to test a pre-defined input sample. The example also supports live capture from camera module and displays the image on the TFT LCD. @@ -75,13 +75,13 @@ The PB1 (SW1) button is located as shown in picture bellow: ### Camera Mode -This mode uses OVM7692 camera module to capture an image in RGB888 format. Since the model is trained using 64x64 pixel image, the PCIF peripheral captures 64x64 pixel image and displays it on LCD. +This mode uses OVM7692 camera module to capture an image in RGB888 format. Since the model is trained using 128x128 pixel image, the PCIF peripheral captures 128x128 pixel image and displays it on LCD. ### Offline Mode To operate in this mode, uncomment "#define USE\_SAMPLEDATA", defined in main.c.� -This mode uses a header file "sampledata.h" containing RGB image data and it should be included in the project to use it as an input to the cnn network.� +This mode uses a header file "sampledata.h" containing RGB image data and it should be included in the project to use it as an input to the CNN network.� To create your own header file follow these steps: diff --git a/Examples/MAX78000/CNN/cats-dogs_demo/main.c b/Examples/MAX78000/CNN/cats-dogs_demo/main.c index 5be310eb8f5..c9145687a93 100644 --- a/Examples/MAX78000/CNN/cats-dogs_demo/main.c +++ b/Examples/MAX78000/CNN/cats-dogs_demo/main.c @@ -151,9 +151,7 @@ static uint8_t *rx_data = NULL; void setup_dma_tft(uint32_t *src_ptr, uint16_t byte_cnt) { // TFT DMA - while ((MXC_DMA->ch[g_dma_channel_tft].status & MXC_F_DMA_STATUS_STATUS)) { - ; - } + while ((MXC_DMA->ch[g_dma_channel_tft].status & MXC_F_DMA_STATUS_STATUS)) {} MXC_DMA->ch[g_dma_channel_tft].status = MXC_F_DMA_STATUS_CTZ_IF; // Clear CTZ status flag MXC_DMA->ch[g_dma_channel_tft].dst = (uint32_t)rx_data; // Cast Pointer @@ -186,9 +184,7 @@ void setup_dma_tft(uint32_t *src_ptr, uint16_t byte_cnt) /* **************************************************************************** */ void start_tft_dma(uint32_t *src_ptr, uint16_t byte_cnt) { - while ((MXC_DMA->ch[g_dma_channel_tft].status & MXC_F_DMA_STATUS_STATUS)) { - ; - } + while ((MXC_DMA->ch[g_dma_channel_tft].status & MXC_F_DMA_STATUS_STATUS)) {} if (MXC_DMA->ch[g_dma_channel_tft].status & MXC_F_DMA_STATUS_CTZ_IF) { MXC_DMA->ch[g_dma_channel_tft].status = MXC_F_DMA_STATUS_CTZ_IF; @@ -400,8 +396,10 @@ int main(void) Camera_Power(POWER_ON); //MXC_Delay(300000); printf("\n\nCats-vs-Dogs Feather Demo\n"); -#else +#elif defined(BOARD_EVKIT_V1) printf("\n\nCats-vs-Dogs Evkit Demo\n"); +#else + printf("\n\nCats-vs-Dogs CAM02 Demo\n"); #endif /* Enable cache */ @@ -463,7 +461,8 @@ int main(void) #ifdef BOARD_EVKIT_V1 camera_write_reg(0x11, 0x1); // set camera clock prescaller to prevent streaming overflow -#else +#endif +#ifdef BOARD_FTHR_REVA camera_write_reg(0x11, 0x0); // set camera clock prescaller to prevent streaming overflow #endif @@ -477,8 +476,10 @@ int main(void) TFT_Print(buff, 20, 130, font_2, snprintf(buff, sizeof(buff), "PRESS PB1(SW1) TO START!")); #endif +#if defined(BOARD_EVKIT_V1) || defined(BOARD_FTHR_REVA) printf("********** Press PB1(SW1) to capture an image **********\r\n"); while (!PB_Get(0)) {} +#endif #ifdef TFT_ENABLE MXC_TFT_ClearScreen(); @@ -566,9 +567,12 @@ int main(void) #ifdef ASCII_ART asciiart((uint8_t *)input_0); - printf("********** Press PB1(SW1) to capture an image **********\r\n"); #endif + +#if defined(BOARD_EVKIT_V1) || defined(BOARD_FTHR_REVA) + printf("********** Press PB1(SW1) to capture an image **********\r\n"); while (!PB_Get(0)) {} +#endif } return 0; diff --git a/Examples/MAX78000/CNN/cats-dogs_demo/project.mk b/Examples/MAX78000/CNN/cats-dogs_demo/project.mk index 3866379ae28..3655680a37f 100644 --- a/Examples/MAX78000/CNN/cats-dogs_demo/project.mk +++ b/Examples/MAX78000/CNN/cats-dogs_demo/project.mk @@ -14,9 +14,20 @@ # Add your config here! # Uncomment the line below to build for the MAX78000FTHR #BOARD=FTHR_RevA +# Uncomment the line below to build for the MAX78000CAM02 +#BOARD = CAM02_RevA -$(info Note: This project is designed and tested for the OV7692 only.) -override CAMERA=OV7692 +ifeq ($(BOARD),EvKit_V1) +CAMERA = OV7692 +endif + +ifeq ($(BOARD),FTHR_RevA) +CAMERA = OV7692 +endif + +ifeq ($(BOARD),CAM02_RevA) +CAMERA = GC0308 +endif # Set a higher optimization level. The increased performance # is required for the CameraIF DMA code to work within the @@ -46,9 +57,3 @@ endif ifeq ($(BOARD),CAM01_RevA) $(error ERR_NOTSUPPORTED: This project is not supported for the CAM01 board) endif - -ifeq ($(BOARD),CAM02_RevA) -$(error ERR_NOTSUPPORTED: This project is not supported for the CAM02 board) -endif - - diff --git a/Examples/MAX78000/ImgCapture/project.mk b/Examples/MAX78000/ImgCapture/project.mk index 949dc364339..7f3441d7ad7 100644 --- a/Examples/MAX78000/ImgCapture/project.mk +++ b/Examples/MAX78000/ImgCapture/project.mk @@ -7,6 +7,8 @@ # ********************************************************** +# Note: To change the target board, see https://analogdevicesinc.github.io/msdk//USERGUIDE/#board-support-packages + # Project options: # Set to 1 to enable, 0 to disable CONSOLE = 1 @@ -28,6 +30,10 @@ ifeq ($(BOARD),CAM01_RevA) CAMERA = HM0360_COLOR endif +ifeq ($(BOARD),CAM02_RevA) +CAMERA = GC0308 +endif + ifeq ($(BOARD),FTHR_RevA) CAMERA = OV7692 endif