File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#!/usr/bin/env python
22
3+ import device_patches # Device specific patches for Jetson Nano (needs to be before importing cv2)
4+
35import cv2
46import os
57import sys , getopt
810from edge_impulse_linux .image import ImageImpulseRunner
911
1012runner = None
11- show_camera = False
1213
1314def now ():
1415 return round (time .time () * 1000 )
Original file line number Diff line number Diff line change 11#!/usr/bin/env python
22
3+ import device_patches # Device specific patches for Jetson Nano (needs to be before importing cv2)
4+
35import cv2
46import os
57import sys , getopt
Original file line number Diff line number Diff line change 11#!/usr/bin/env python
22
3+ import device_patches # Device specific patches for Jetson Nano (needs to be before importing cv2)
4+
35import cv2
46import os
57import sys , getopt
810from edge_impulse_linux .image import ImageImpulseRunner
911
1012runner = None
13+ # if you don't want to see a camera preview, set this to False
1114show_camera = True
15+ if (sys .platform == 'linux' and not os .environ .get ('DISPLAY' )):
16+ show_camera = False
1217
1318def now ():
1419 return round (time .time () * 1000 )
Original file line number Diff line number Diff line change 1+ import os
2+
3+ def get_device ():
4+ # On Jetson Nano `OPENBLAS_CORETYPE=ARMV8` needs to be set, otherwise including OpenCV
5+ # throws an illegal instruction error
6+ if (os .path .exists ('/proc/device-tree/model' )):
7+ with open ('/proc/device-tree/model' , 'r' ) as f :
8+ model = f .read ()
9+ if ('NVIDIA Jetson Nano' in model ):
10+ return 'jetson-nano'
11+ return 'unknown'
12+
13+ device = get_device ()
14+ if (device == 'jetson-nano' ):
15+ os .environ ['OPENBLAS_CORETYPE' ] = 'ARMV8'
You can’t perform that action at this time.
0 commit comments