Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
400 changes: 400 additions & 0 deletions reconnaissance images/object_detection/data/mscoco_label_map.pbtxt

Large diffs are not rendered by default.

99 changes: 99 additions & 0 deletions reconnaissance images/object_detection/data/pascal_label_map.pbtxt
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
item {
id: 1
name: 'aeroplane'
}

item {
id: 2
name: 'bicycle'
}

item {
id: 3
name: 'bird'
}

item {
id: 4
name: 'boat'
}

item {
id: 5
name: 'bottle'
}

item {
id: 6
name: 'bus'
}

item {
id: 7
name: 'car'
}

item {
id: 8
name: 'cat'
}

item {
id: 9
name: 'chair'
}

item {
id: 10
name: 'cow'
}

item {
id: 11
name: 'diningtable'
}

item {
id: 12
name: 'dog'
}

item {
id: 13
name: 'horse'
}

item {
id: 14
name: 'motorbike'
}

item {
id: 15
name: 'person'
}

item {
id: 16
name: 'pottedplant'
}

item {
id: 17
name: 'sheep'
}

item {
id: 18
name: 'sofa'
}

item {
id: 19
name: 'train'
}

item {
id: 20
name: 'tvmonitor'
}
184 changes: 184 additions & 0 deletions reconnaissance images/object_detection/data/pet_label_map.pbtxt
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
item {
id: 1
name: 'Abyssinian'
}

item {
id: 2
name: 'american_bulldog'
}

item {
id: 3
name: 'american_pit_bull_terrier'
}

item {
id: 4
name: 'basset_hound'
}

item {
id: 5
name: 'beagle'
}

item {
id: 6
name: 'Bengal'
}

item {
id: 7
name: 'Birman'
}

item {
id: 8
name: 'Bombay'
}

item {
id: 9
name: 'boxer'
}

item {
id: 10
name: 'British_Shorthair'
}

item {
id: 11
name: 'chihuahua'
}

item {
id: 12
name: 'Egyptian_Mau'
}

item {
id: 13
name: 'english_cocker_spaniel'
}

item {
id: 14
name: 'english_setter'
}

item {
id: 15
name: 'german_shorthaired'
}

item {
id: 16
name: 'great_pyrenees'
}

item {
id: 17
name: 'havanese'
}

item {
id: 18
name: 'japanese_chin'
}

item {
id: 19
name: 'keeshond'
}

item {
id: 20
name: 'leonberger'
}

item {
id: 21
name: 'Maine_Coon'
}

item {
id: 22
name: 'miniature_pinscher'
}

item {
id: 23
name: 'newfoundland'
}

item {
id: 24
name: 'Persian'
}

item {
id: 25
name: 'pomeranian'
}

item {
id: 26
name: 'pug'
}

item {
id: 27
name: 'Ragdoll'
}

item {
id: 28
name: 'Russian_Blue'
}

item {
id: 29
name: 'saint_bernard'
}

item {
id: 30
name: 'samoyed'
}

item {
id: 31
name: 'scottish_terrier'
}

item {
id: 32
name: 'shiba_inu'
}

item {
id: 33
name: 'Siamese'
}

item {
id: 34
name: 'Sphynx'
}

item {
id: 35
name: 'staffordshire_bull_terrier'
}

item {
id: 36
name: 'wheaten_terrier'
}

item {
id: 37
name: 'yorkshire_terrier'
}
64 changes: 64 additions & 0 deletions reconnaissance images/object_detection/filevideostream.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# import the necessary packages
from threading import Thread
import sys
import cv2

# import the Queue class from Python 3
if sys.version_info >= (3, 0):
from queue import Queue

# otherwise, import the Queue class for Python 2.7
else:
from Queue import Queue

class FileVideoStream:
def __init__(self, path, queueSize=128):
# initialize the file video stream along with the boolean
# used to indicate if the thread should be stopped or not
self.stream = cv2.VideoCapture(path)
self.stopped = False

# initialize the queue used to store frames read from
# the video file
self.Q = Queue(maxsize=queueSize)

def start(self):
# start a thread to read frames from the file video stream
t = Thread(target=self.update, args=())
t.daemon = True
t.start()
return self

def update(self):
# keep looping infinitely
while True:
# if the thread indicator variable is set, stop the
# thread
if self.stopped:
return

# otherwise, ensure the queue has room in it
if not self.Q.full():
# read the next frame from the file
(grabbed, frame) = self.stream.read()

# if the `grabbed` boolean is `False`, then we have
# reached the end of the video file
if not grabbed:
self.stop()
return

# add the frame to the queue
self.Q.put(frame)

def read(self):
# return next frame in the queue
return self.Q.get()

def more(self):
# return True if there are still frames in the queue
return self.Q.qsize() > 0

def stop(self):
# indicate that the thread should be stopped
self.stopped = True
33 changes: 33 additions & 0 deletions reconnaissance images/object_detection/fps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# import the necessary packages
import datetime

class FPS:
def __init__(self):
# store the start time, end time, and total number of frames
# that were examined between the start and end intervals
self._start = None
self._end = None
self._numFrames = 0

def start(self):
# start the timer
self._start = datetime.datetime.now()
return self

def stop(self):
# stop the timer
self._end = datetime.datetime.now()

def update(self):
# increment the total number of frames examined during the
# start and end intervals
self._numFrames += 1

def elapsed(self):
# return the total number of seconds between the start and
# end interval
return (self._end - self._start).total_seconds()

def fps(self):
# compute the (approximate) frames per second
return self._numFrames / self.elapsed()
Loading