# Reading numbers (training info)

**URL:** <https://forums.openmv.io/t/reading-numbers-training-info/600>\
**Category:** OpenMV Boards\
**Created:** [March 5, 2018, 7:05pm UTC](https://forums.openmv.io/t/reading-numbers-training-info/600 "2018-03-05T19:05:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kikiorg](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kikiorg/32/32_2.png) [@kikiorg](https://forums.openmv.io/u/kikiorg)\
**Post date:** [March 5, 2018, 7:05pm UTC](https://forums.openmv.io/t/reading-numbers-training-info/600/1 "2018-03-05T19:05:46Z")

</div>

I’ve tried the library version of reading numbers and it’s not accurate enough for what I need to do. Same for the image template function.

I’ve trained a model in Tensorflow, and would love to use my model since it is tuned to the font I’m trying to read. But TF is a big beast to drag into this tiny space, when all I need to do is read, not train.

Alternately, I’d be happy to use my training data to train the model used by the OpenMV library, since it does fit on the board. Can I train the OpenMV number recognition?

Any pointers to making this work?

Thanks.

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [March 5, 2018, 7:56pm UTC](https://forums.openmv.io/t/reading-numbers-training-info/600/2 "2018-03-05T19:56:58Z")

</div>

Hi, we just integrated ARMs new CMSIS neural network library. It works using caffe I think. So, you’ll have to import you model into caffe and then export to binary header files.

It’s somewhat of a lot of work to do right now… But, technically cutting edge since no one else has done this yet.

I’ll be focused more on building our the code infrastructure in the future to make exporting a model from TF/caffe/pytorch easy and being able to load that with the camera. However, there are a lot of other to do items to focus on in the mean time.

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [March 5, 2018, 7:59pm UTC](https://forums.openmv.io/t/reading-numbers-training-info/600/3 "2018-03-05T19:59:30Z")

</div>

Here’s where we pulled the NN code:

[https://github.com/ARM-software/CMSIS\_5/blob/develop/CMSIS/NN/Examples/ARM/arm\_nn\_examples/cifar10/arm\_nnexamples\_cifar10.cpp](https://github.com/ARM-software/CMSIS_5/blob/develop/CMSIS/NN/Examples/ARM/arm_nn_examples/cifar10/arm_nnexamples_cifar10.cpp)

Here’s where we put it:

[https://github.com/openmv/openmv/blob/master/src/omv/img/cifar10.c](https://github.com/openmv/openmv/blob/master/src/omv/img/cifar10.c)

[https://github.com/openmv/openmv/blob/master/src/omv/img/cifar10\_model.c](https://github.com/openmv/openmv/blob/master/src/omv/img/cifar10_model.c)

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [March 5, 2018, 8:01pm UTC](https://forums.openmv.io/t/reading-numbers-training-info/600/4 "2018-03-05T20:01:56Z")

</div>

To make this flexible to run any model we’ll have to build up an infrastructure that let’s you port a small NN to the camera. I think this will involved being able to parse the network topology in a binary file along with the weights.

If you want to contribute, figuring out a good way to generate a binary file with the network topology and weights, etc from any library would be the first step. Then writing a parser to load that would be the next step.

---

<div class="post-metadata">

**Author:** ![kikiorg](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kikiorg/32/32_2.png) [@kikiorg](https://forums.openmv.io/u/kikiorg)\
**Post date:** [March 8, 2018, 1:15am UTC](https://forums.openmv.io/t/reading-numbers-training-info/600/5 "2018-03-08T01:15:44Z")

</div>

Thanks for the reply and code pointers.

I’d be very happy to contribute to that project, if my job allows. It seems like there are a number of projects here for which this would be useful to others.

I have a background in computer graphics programming, so all of this feels very familiar. “Back in mah days we had to _write_ our own linear algebra libraries for our ray tracers!! Uphill both ways!” 🙂 It _seems_ pretty straightforward to me…

I got busy with other things, but I’m ready to approach this again. I will look at this tomorrow and keep you posted on my progress.
