* Update cifar10_fast network (retrained for better accuracy).
* Fix and update smile network (use hdf5 for consistency with other models and update hyper-parameters).
This fix creates a flag that prevents fb_alloc_free_till_mark() from
doing anything unless there was a previous fb_alloc_mark(). Once
fb_alloc_free_till_mark() is called it will no longer do anything until
there's another fb_alloc_mark().
This means that if an exception is triggered while in code that
previously did fb_alloc_mark() the stack will be cleaned up.
If the fb_alloc_mark() method is not called then the stack will not be
cleaned up and that memory fb_alloc()'ed will remain until a soft reset.
All OpenMV Cam library code is designed to fb_alloc_mark() before using
the fb stack and then fb_alloc_free_till_mark() when complete. However,
in the case of py_sensor_alloc_extra_fb() it doesn't mark first such
that the RAM it allocates stays across exceptions and is only free'd via
py_sensor_dealloc_extra_fb() or via a soft reset.
...
Summary of changes:
fb_alloc.c -> Added a semaphore lock to prevent
fb_alloc_free_till_mark() from doing anything unless fb_alloc_mark() was
called first.
py_sensor.c -> Removed calling fb_alloc_mark() and
fb_alloc_free_till_mark() and re-arranged code calls to prevent a trival
leak sitatuion on heap exhaustion.
py_image.c, py_fir.c, py_lcd.c py_tv.c -> Added fb_alloc_mark() and
fb_alloc_free_till_mark() to methods originally coded without using it.
...
Note - I coded the mark semaphore lock in such a way things work even if
fb_alloc_mark() and fb_alloc_free_till_mark() calls are nested. This
allows the find_blobs() call-back methods to call py_image.c methods
still and also allows us to add more call-backs in the future without
worry if we need to.
...
Finally, if you have an exception in an interrupt handler all this above
breaks terribly. Given MP already breaks if you try to allocate memory
in an exception this is a "won't fix problem". Don't call code that can
have exceptions or needs memory in an interrupt handler.
The FLIR Lepton 3.5 sometimes doesn't startup. Our previous code just
waited forever. The new code now will timeout but also will try to
recoever the FLIR Lepton 3.5 if possible if the video doesn't start in a
timely manner.
Measurement mode allows you to set a target temperature for the FLIR
lepton so that you can actually use it to measure object temperatures
and do useful things. We try to make the mode work on non-radiometric
FLIR letpons howeever it will not be accurate.