Skip to content

Commit

Permalink
Revert "fix(Examples): Updated CAM02 examples (#963)"
Browse files Browse the repository at this point in the history
This reverts commit 0038d43.
  • Loading branch information
EricB-ADI committed Aug 21, 2024
1 parent 29e4c66 commit 28f2b84
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 35 deletions.
6 changes: 3 additions & 3 deletions Examples/MAX78000/CNN/cats-dogs_demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 128x128 pixels RGB which is 3x128x128 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 64x64 pixels RGB which is 3x64x64 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.

Expand Down Expand Up @@ -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 128x128 pixel image, the PCIF peripheral captures 128x128 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 64x64 pixel image, the PCIF peripheral captures 64x64 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:

Expand Down
22 changes: 9 additions & 13 deletions Examples/MAX78000/CNN/cats-dogs_demo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ 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
Expand Down Expand Up @@ -184,7 +186,9 @@ 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;
Expand Down Expand Up @@ -396,10 +400,8 @@ int main(void)
Camera_Power(POWER_ON);
//MXC_Delay(300000);
printf("\n\nCats-vs-Dogs Feather Demo\n");
#elif defined(BOARD_EVKIT_V1)
printf("\n\nCats-vs-Dogs Evkit Demo\n");
#else
printf("\n\nCats-vs-Dogs CAM02 Demo\n");
printf("\n\nCats-vs-Dogs Evkit Demo\n");
#endif

/* Enable cache */
Expand Down Expand Up @@ -461,8 +463,7 @@ int main(void)

#ifdef BOARD_EVKIT_V1
camera_write_reg(0x11, 0x1); // set camera clock prescaller to prevent streaming overflow
#endif
#ifdef BOARD_FTHR_REVA
#else
camera_write_reg(0x11, 0x0); // set camera clock prescaller to prevent streaming overflow
#endif

Expand All @@ -476,10 +477,8 @@ 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();
Expand Down Expand Up @@ -567,12 +566,9 @@ int main(void)

#ifdef ASCII_ART
asciiart((uint8_t *)input_0);
#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
while (!PB_Get(0)) {}
}

return 0;
Expand Down
21 changes: 8 additions & 13 deletions Examples/MAX78000/CNN/cats-dogs_demo/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,9 @@
# 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

ifeq ($(BOARD),EvKit_V1)
CAMERA = OV7692
endif

ifeq ($(BOARD),FTHR_RevA)
CAMERA = OV7692
endif

ifeq ($(BOARD),CAM02_RevA)
CAMERA = GC0308
endif
$(info Note: This project is designed and tested for the OV7692 only.)
override CAMERA=OV7692

# Set a higher optimization level. The increased performance
# is required for the CameraIF DMA code to work within the
Expand Down Expand Up @@ -57,3 +46,9 @@ 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


6 changes: 0 additions & 6 deletions Examples/MAX78000/ImgCapture/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

# **********************************************************

# 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
Expand All @@ -30,10 +28,6 @@ ifeq ($(BOARD),CAM01_RevA)
CAMERA = HM0360_COLOR
endif

ifeq ($(BOARD),CAM02_RevA)
CAMERA = GC0308
endif

ifeq ($(BOARD),FTHR_RevA)
CAMERA = OV7692
endif
Expand Down

0 comments on commit 28f2b84

Please sign in to comment.