Monica HoustonJason Lambert
Published © MIT

Run Practically Any Tensorflow Model on MaaXBoard RT

Yes, it's possible to run any.tflite model on MaaXBoard RT as long as it fits in memory!

IntermediateProtip2 hours1,099
Run Practically Any Tensorflow Model on MaaXBoard RT

Things used in this project

Hardware components

NXP MCU Link
×1
MaaXBoard RT
Tria Technologies MaaXBoard RT
×1
Tria Technologies Avnet 5V/3A USB Type-c power supply
×1
Tria Technologies Avnet MaaXBoard 7" MIPI Display
×1
Tria Technologies Avnet MaaXBoard Camera Module
×1

Software apps and online services

TensorFlow
TensorFlow

Story

Read more

Schematics

MaaXBoard with Camera, LCD and MCULink connected

MaaXBoard with MCULink connected

MaaXBoard with LCD connected

Code

MaaX_v2_tensorflow_lite_micro_label_image_cm7.zip

C/C++
Tensorflow label image example for MaaXBoard RT
No preview (download only).

replace_label_text.py

Python
Use this script to convert labels.txt to c header labels.h
#!/usr/bin/env python3
import fileinput

filename="mobilenet_labels.txt"
outFile="labels.h"
# text_to_search=

# with fileinput.FileInput(filename, inplace=True, backup='.bak') as file:
#     for line in file:
#         print(line.replace(text_to_search, replacement_text), end='')

import re
with open (filename, 'r' ) as f, open(outFile,'w') as w:
    for line in f.readlines():
        if f.isfirstline():
             w.write(line.rstrip('\r\n') + '\n' + 'const char* labels[] = {')
        else:
            w.write("\"%s\",\n" % line.rstrip('\n'))
    w.write('\r\n};' + '\n')
    
    
print("labels replaced")

MaaXBoard-RT-V3--Tensorflow-Lite

Credits

Monica Houston
80 projects • 463 followers
I don't live on a boat anymore.
Contact
Jason Lambert
0 projects • 2 followers
Florida mountain man
Contact

Comments

Please log in or sign up to comment.