<commit_before># Native C++ Example using Gstreamer

This directory contains a C++ Gstreamer example for classification model to work with the [Coral Dev Board](https://coral.withgoogle.com/products/dev-board/).
The app itself `mendelcam` is built from a provided docker image that fetches all required dependencies and build it.
The docker build was tested on the Dev Board, however, it can can support k8, aach64, and armv7a.

## Prepare the device and copy the source code to the device

1. If you haven't done so already, set up your board according to [Get started with the Dev Board](https://coral.ai/docs/dev-board/get-started).

2. Cross-compile for aarch64 from your Linux desktop (do not run this on the Dev Board)::
```
cd nativeapp
make DOCKER_TARGETS=mendelcam DOCKER_CPUS=aarch64 docker-build
```

3. Copy models and binaries to the board:
First download model:
```
../download_models.sh
```
Then copy models and binaries to the board:
```
mdt push imagenet_labels.txt
mdt push mobilenet_v2_1.0_224_quant_edgetpu.tflite
mdt push out/aarch64/demo/mendelcam
```

3. Connect to the device:
```
mdt shell
```

4. To run:
In the nativeapp directory on the target (don't forget `mdt shell`) run:
```<commit_msg>Update build instructions for dev board<commit_after># Native C++ Example using Gstreamer

This directory contains a C++ Gstreamer example for classification model to work with the [Coral Dev Board](https://coral.withgoogle.com/products/dev-board/).
The app itself `mendelcam` is built from a provided docker image that fetches all required dependencies and build it.
The docker build was tested on the Dev Board, however, it can can support k8, aach64, and armv7a.

## Prepare the device and copy the source code to the device

1. If you haven't done so already, set up your board according to [Get started with the Dev Board](https://coral.ai/docs/dev-board/get-started).

2. Cross-compile for aarch64 from your Linux desktop (do not run this on the Dev Board):
```
cd nativeapp
make DOCKER_TARGETS=mendelcam DOCKER_CPUS=aarch64 docker-build
```

3. Copy models and binaries to the board:
First download model:
```
../download_models.sh
```
Then copy models and binaries to the board:
```
mdt push imagenet_labels.txt
mdt push mobilenet_v2_1.0_224_quant_edgetpu.tflite
mdt push out/aarch64/demo/mendelcam
```

3. Connect to the device:
```
mdt shell
```

4. To run:
In the nativeapp directory on the target (don't forget `mdt shell`) run:
```
{'fraction_non_alphanumeric': 0.0881039382866423, 'fraction_numerical': 0.01705237515225335, 'mean_word_length': 4.6255707762557075, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2928454', 'n_tokens_mistral': 801, 'n_tokens_neox': 754, 'n_words': 331}