mocleiri / tensorflow-micropython-examples

A custom micropython firmware integrating tensorflow lite for microcontrollers and ulab to implement the tensorflow micro examples.
MIT License
170 stars 79 forks source link

esp32cam capturing and saving image works on repl but not from script #83

Open TecDroiD opened 2 years ago

TecDroiD commented 2 years ago

hi, i want to get some grayscale image from esp32cam module and thought that it's the easiest to capture a raw image, save it and read it via ampy get...

tought...

having the following code in repl: import camera

camera.init(0,format=camera.GRAYSCALE, framesize=camera.FRAME_VGA)
img = camera.capture()
with open ('image.sc', 'wb') as fp:
   fp.write(img)

I can save my image and read it after

now I have saved same code into a script capture.py, uploaded it and ran.. it hangs at write(img)... and never wakes up again until i press reset button..

... but why?

edit: running on MicroPython dbe5289-dirty on 2022-03-15; ESP32-cam module (microlite) with ESP32