Skip to content

inaghnane/RealTimeObjectDetection

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

collectdimages

#!pip install opencv-python

import cv2 #opencv import os # move hands import time import uuid

IMAGES_PATH = 'Tensorflow/workspace/images/collectdimages'

labels = ['yes', 'no'] number_imgs = 15

for label in labels: !mkdir {'Tensorflow\workspace\images\collectdimages\'+label} cap = cv2.VideoCapture(0) print('Collecting images for {}'.format(label)) time.sleep(5) for imgnum in range(number_imgs): ret, frame = cap.read() imgname = os.path.join(IMAGES_PATH , label,label+'.'+'{}.jpg'.format(str(uuid.uuid1()))) cv2.imwrite(imgname,frame) cv2.imshow('frame',frame) time.sleep(2)

    if cv2.waitKey(1) & 0xFF == ord ('q'):
        break
        cap.release( )

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 76.2%
  • Python 23.8%