File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 2020
2121imx500 = IMX500 (model_path )
2222
23- # Test getting the device ID.
24- device_id = imx500 .get_device_id ()
25- print ("Device ID:" , device_id )
26- if not device_id :
27- print ("ERROR: empty device ID" )
28-
2923# Start the camera and capture some frames with output tensors.
3024picam2 = Picamera2 (imx500 .camera_num )
3125config = picam2 .create_preview_configuration (buffer_count = 12 )
3226picam2 .configure (config )
3327picam2 .start ()
3428
29+ # wait for the device to be streaming before reading id.
30+ picam2 .capture_metadata ()
31+ device_id = imx500 .get_device_id ()
32+ print ("Device ID:" , device_id )
33+ if not device_id :
34+ print ("ERROR: empty device ID" )
35+ picam2 .stop ()
36+ picam2 .close ()
37+ exit ()
38+
3539NUM_FRAMES = 30
3640
3741tensor_count = 0
You can’t perform that action at this time.
0 commit comments