Oscar Julian Perdomo CharryHERNAN BERNAL
Published © MIT

Automatic detection of activities in first person videos

Identify activities of daily life, through the detection of objects in videos taken with a first-person camera and assist with voice.

AdvancedFull instructions provided24 hours117
Automatic detection of activities in first person videos

Things used in this project

Hardware components

NVIDIA Jetson Nano Developer Kit
NVIDIA Jetson Nano Developer Kit
×1
AIY Voice
Google AIY Voice
×1
Raspberry Pi Zero
Raspberry Pi Zero
×1

Software apps and online services

Raspbian
Raspberry Pi Raspbian
Linux Driver Package
Google DialogFlow

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Read more

Custom parts and enclosures

3D Jetson Nano Case

Code

transfer_learning_license_kitchen_recognition.py

Python
Jetson nano code
# -*- coding: utf-8 -*-
"""Transfer Learning license kitchen recognition.ipynb

Automatically generated by Colaboratory.

Original file is located at
    https://colab.research.google.com/drive/1XoPOF60tM-7hot61yhOnXEiUVA-ZaQjS
"""

!nvidia-smi

!pip install onnx

from google.colab import drive
drive.mount('/gdrive')
# Si colocan algun archivo nuevo
#drive.mount("/gdrive", force_remount=True)

import os
os.chdir('/gdrive/MyDrive/UR/JetsonNano/ssd')
!ls

#!unzip '/content/drive/MyDrive/colabs/JetsonNano/ssd.zip'

os.chdir('/gdrive/MyDrive/UR/JetsonNano/ssd')
!ls

!wget https://nvidia.box.com/shared/static/djf5w54rjvpqocsiztzaandq1m3avr7c.pth -O models/mobilenet-v1-ssd-mp-0_675.pth

!pip install boto3

!python open_images_downloader.py --class-names 'Refrigerator,Gas stove,Mug,Kitchen & dining room table,Blender,Cabinetry,Plate,Wok,Kitchen utensil,Bowl' --data=data/plate

!python train_ssd.py --data=data/plate --model-dir=models/plate --batch-size=128 --num-epochs=5 --resume models/plate/mb1-ssd-Epoch-4-Loss-3.3897489309310913.pth

!python onnx_export.py --input=models/plate/mb1-ssd-Epoch-4-Loss-3.3897489309310913.pth --output=./models/ssd_kitchen_2.onnx --labels=./models/plate/labels.txt

!pip install jetson-emulator

import jetson_emulator

import jetson_emulator.inference as inference
import jetson_emulator.utils as utils

# load the recognition network
net = inference.imageNet("googlenet")
for x in range(1,6):
	# emulator API to generate sample images for imageNet
	filename = net.emulatorGetImageFile()
	img = utils.loadImage(filename)
	class_idx, confidence = net.Classify(img)
	class_desc = net.GetClassDesc(class_idx)
	print("image "+str(x)+" is recognized as '{:s}' (class #{:d}) with {:f}% confidence".
	format(class_desc, class_idx, confidence*100))

Code

Credits

Oscar Julian Perdomo Charry

Oscar Julian Perdomo Charry

2 projects • 2 followers
Associate professor, Faculty of Engineering - Department of Electric and Electronic Engineering, Universidad Nacional de Colombia
HERNAN BERNAL

HERNAN BERNAL

0 projects • 1 follower
Thanks to Elkin Estiven González Cuellar and Rolffer Alexander Ramírez Serrano.

Comments