This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import platform | |
PLATFORM = platform.system().lower() | |
GOOGLE = 'edge_tpu' | |
INTEL = 'ncs2' | |
NVIDIA = 'jetson_nano' | |
PI = 'raspberry_pi' | |
IS_LINUX = (PLATFORM == 'linux') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import platform | |
PLATFORM = platform.system().lower() | |
GOOGLE = 'edge_tpu' | |
INTEL = 'ncs2' | |
NVIDIA = 'jetson_nano' | |
PI = 'raspberry_pi' | |
IS_LINUX = (PLATFORM == 'linux') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import platform | |
PLATFORM = platform.system().lower() | |
GOOGLE = 'edge_tpu' | |
INTEL = 'ncs2' | |
NVIDIA = 'jetson_nano' | |
PI = 'raspberry_pi' | |
MAC = 'darwin' | |
IS_LINUX = (PLATFORM == 'linux') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 person | |
2 bicycle | |
3 car | |
4 motorcycle | |
5 airplane | |
6 bus | |
7 train | |
8 truck | |
9 boat | |
10 traffic light |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# require CMake 2.8 or greater | |
cmake_minimum_required(VERSION 2.8) | |
# declare my-recognition project | |
project(object_recognition) | |
# import jetson-inference and jetson-utils packages. | |
# note that if you didn't do "sudo make install" | |
# while building jetson-inference, this will error. | |
find_package(jetson-utils) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Object Recognition example code from NVIDIA | |
// See https://github.com/dusty-nv/jetson-inference/blob/master/examples/my-recognition/my-recognition.cpp | |
#include <jetson-inference/imageNet.h> | |
#include <jetson-utils/loadImage.h> | |
int main( int argc, char** argv ){ | |
if( argc < 2 ) { | |
printf("object_recognition: expected image filename as argument\n"); | |
printf("example usage: ./object_recognition image.jpg\n"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://retropie.org.uk/forum/topic/2295/runcommand-warning-if-voltage-temperature-throttling | |
#Flag Bits | |
UNDERVOLTED=0x1 | |
CAPPED=0x2 | |
THROTTLED=0x4 | |
HAS_UNDERVOLTED=0x10000 | |
HAS_CAPPED=0x20000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import platform | |
import subprocess | |
from edgetpu.detection.engine import DetectionEngine | |
from PIL import Image | |
from PIL import ImageFont, ImageDraw | |
# Function to draw a rectangle with width > 1 | |
def draw_rectangle(draw, coordinates, color, width=1): | |
for i in range(width): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""A demo for object detection. | |
For Raspberry Pi, you need to install 'feh' as image viewer: | |
sudo apt-get install feh | |
Example (Running in /usr/lib/python3/dist-packages/edgetpu): | |
- Face detection: | |
python3 demo/object_detection.py \ | |
--model='test_data/mobilenet_ssd_v2_face_quant_postprocess_edgetpu.tflite' \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""A demo to classify image.""" | |
import argparse | |
from edgetpu.classification.engine import ClassificationEngine | |
from PIL import Image | |
# Function to read labels from text files. | |
def ReadLabelFile(file_path): | |
with open(file_path, 'r') as f: | |
lines = f.readlines() | |
ret = {} |