img-chars74k.network network module missing,

Discussion related to "under the hood" OpenMV topics.
bob63
Posts: 27
Joined: Sun Aug 07, 2016 8:41 am

img-chars74k.network network module missing,

Postby bob63 » Thu Apr 25, 2019 8:25 am

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 ?

Code: Select all

# 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
User avatar
kwagyeman
Posts: 4230
Joined: Sun May 24, 2015 2:10 pm

Re: img-chars74k.network network module missing,

Postby kwagyeman » Thu Apr 25, 2019 8:10 pm

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: https://github.com/kwagyeman/openmv/blo ... ecognition
Nyamekye,
bob63
Posts: 27
Joined: Sun Aug 07, 2016 8:41 am

Re: img-chars74k.network network module missing,

Postby bob63 » Fri Apr 26, 2019 3:45 am

OK ! No problems ...

Thanks.
Pooyan
Posts: 4
Joined: Wed Jan 29, 2020 8:56 am

Re: img-chars74k.network network module missing,

Postby Pooyan » Wed Jan 29, 2020 9:11 am

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
User avatar
kwagyeman
Posts: 4230
Joined: Sun May 24, 2015 2:10 pm

Re: img-chars74k.network network module missing,

Postby kwagyeman » Wed Jan 29, 2020 10:07 am

What are you having an issue with?
Nyamekye,
Pooyan
Posts: 4
Joined: Wed Jan 29, 2020 8:56 am

Re: img-chars74k.network network module missing,

Postby Pooyan » Wed Jan 29, 2020 10:36 am

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
🙏
This is the example which l find :

Code: Select all

# 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.
User avatar
iabdalkader
Posts: 1190
Joined: Sun May 24, 2015 3:53 pm

Re: img-chars74k.network network module missing,

Postby iabdalkader » Wed Jan 29, 2020 12:03 pm

You just need to copy this network to SD and the run the script, but I don't think we have that network.
Pooyan
Posts: 4
Joined: Wed Jan 29, 2020 8:56 am

Re: img-chars74k.network network module missing,

Postby Pooyan » Wed Jan 29, 2020 12:27 pm

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 ?
User avatar
kwagyeman
Posts: 4230
Joined: Sun May 24, 2015 2:10 pm

Re: img-chars74k.network network module missing,

Postby kwagyeman » Wed Jan 29, 2020 1:51 pm

Tools->Machine Vision->CNN Network Library in the IDE.
Nyamekye,
Pooyan
Posts: 4
Joined: Wed Jan 29, 2020 8:56 am

Re: img-chars74k.network network module missing,

Postby Pooyan » Wed Jan 29, 2020 2:41 pm

Thank you
🙏

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 13 guests