img-chars74k.network network module missing,

Hi , I’ve just received my H7 and try to use the machine learning example on IDE 2.2.0.

Locking the nn_chars74k_2.py example I was expecting to find into the network models folder the 3 files mentioned as possible alternatives,but is available just the fnt-chars74k.network.

Another doubt is about the line “works hand written chars” and the one**" for printed font"** that seems use the same network module . Is it correct or is a typo error ?

# Load chars74 network
net = nn.load('/fnt-chars74k.network') # works on printed font
# net = nn.load('/fnt-chars74k.network') # works on handwritten chars
# net = nn.load('/img-chars74k.network') # works on images of chars

Thanks

Hi, sorry, I was in a rush releasing that script. The other two networks don’t work. I haven’t bothered to release them. Please delete those two lines. I have a write-up on how to train the other two networks but they score very low.

And yes, it’s a typo with the second network. Um, here’s the GitHub link to how those were trained: openmv/README.md at more_nn_nets · kwagyeman/openmv · GitHub

OK ! No problems …

Thanks.

Hi I am working on a project in which the camera should detect these characters ( H , S ,U ) and my camera model is M7 I’ll be thankful if you help me

What are you having an issue with?

actually it’s the first time that I am using this camera and I am not familiar with it so I search in YouTube and I find this example but my open Mv cam gives an OSError in the line 17 and says could not find the file ( my camera model is M7 ) and I don’t know what should I do now I’ll be thankful if you guide me and if I am wrong could you please tell me the right way . Thanks
:pray:
This is the example which l find :

# Chars74K CNN Example
#
# This example shows off how to use the OpenMV Cam to detect
# characters 0-9 A-Z a-z.

import sensor, image, time, os, nn

sensor.reset()                         # Reset and initialize the sensor.
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to GRAYSCALE
sensor.set_framesize(sensor.QVGA)      # Set frame size to QVGA (320x240)
sensor.set_windowing((128, 128))       # Set 128x128 window.
sensor.skip_frames(time=500)
sensor.set_auto_gain(False)
sensor.set_auto_exposure(False)

# Load chars74 network
net = nn.load('/fnt-chars74k.network') # works on printed font
 👉 the problem is in the previous line 
# net = nn.load('/fnt-chars74k.network') # works on handwritten chars
# net = nn.load('/img-chars74k.network') # works on images of chars
labels = ['n/a', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
for i in range(ord('A'), ord('Z') + 1): labels.append(chr(i))
for i in range(ord('a'), ord('z') + 1): labels.append(chr(i))

clock = time.clock()                # Create a clock object to track the FPS.
while(True):
    clock.tick()                    # Update the FPS clock.
    img = sensor.snapshot()         # Take a picture and return the image.
    out = net.forward(img.binary([(200, 255)]), softmax=True)
    max_idx = out.index(max(out))
    score = int(out[max_idx]*100)
    if (score < 50):
        score_str = "??:??%"
    else:
        score_str = "%s:%d%% "%(labels[max_idx], score)
    img.draw_string(0, 0, score_str, color=(255, 0, 0))

    print(clock.fps())             # Note: OpenMV Cam runs about half as fast when connected
                                   # to the IDE. The FPS should increase once disconnected.

You just need to copy this network to SD and the run the script, but I don’t think we have that network.

Thank you very much for your help .
I’ll be thankful if you could tell me where can I find or search for this network ?

Tools->Machine Vision->CNN Network Library in the IDE.

Thank you
:pray:

Hi,

I am trying to get a character recognition example working. I have looked for this example nn_chars74k_2.py and I have looked for this network fnt-chars74k.network. I cannot find them anywhere in the IDE (2.6).
Am I doing something wrong, have I missed something. The posts in this discussion are from earlier this year so I assume this is still applicable?
Under Tools->Machine Vision-> CNN Network Library I see this:
Screenshot from 2020-09-08 18-14-00.png
Under mobile net (as expected) are the mobile net tensor flow lite models.

Thanks in advance.

Haemish

Hi, we moved to TensorFlow and have discontinued support of this module.

If you want to recognize characters just collect a dataset of them and use edge impulse to train a CNN for this. It only takes 15-30 minutes and it’s much better than using a large network that is not targeted at your application.

Thanks. I was not aware of that and these forums can be a bit confusing when referencing older versions.
I will investigate your suggestion.

Many thanks.