def process_facerecog():
	input_video = 0

	# By default I use an "SSD with Mobilenet" model here. See the detection model zoo (https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md) for a list of other models that can be run out-of-the-box with varying speeds and accuracies.
	detection_graph, category_index = backbone.set_model('ssd_mobilenet_v1_coco_2017_11_17')

	targeted_objects = "person"
	fps = 24 # change it with your input video fps
	width = 640 # change it with your input video width
	height = 480 # change it with your input vide height
	is_color_recognition_enabled = 0 # set it to 1 for enabling the color prediction for the detected objects
	roi = 350 # roi line position
	deviation = 3 # the constant that represents the object counting area

	object_counting_api.cumulative_object_counting_y_axis(input_video, detection_graph, category_index, is_color_recognition_enabled, targeted_objects,fps, width, height, roi, deviation) # counting all the objects
#----------------------------------------------
#--- Author         : Ahmet Ozlu
#--- Mail           : [email protected]
#--- Date           : 27th January 2018
#----------------------------------------------

# Imports
import tensorflow as tf

# Object detection imports
from utils import backbone
from api import object_counting_api

input_video = "./input_images_and_videos/vehicle_survaillance.mp4"

# By default I use an "SSD with Mobilenet" model here. See the detection model zoo (https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md) for a list of other models that can be run out-of-the-box with varying speeds and accuracies.
detection_graph, category_index = backbone.set_model('ssd_mobilenet_v1_coco_2018_01_28', 'mscoco_label_map.pbtxt')

is_color_recognition_enabled = 1 # set it to 1 for enabling the color prediction for the detected objects
roi = 185 # roi line position
deviation = 2 # the constant that represents the object counting area
custom_object_name = 'Vehicle' # set it to your custom object name

object_counting_api.cumulative_object_counting_y_axis(input_video, detection_graph, category_index, is_color_recognition_enabled, roi, deviation, custom_object_name) # counting all the objects
Exemple #3
0
# Imports
import tensorflow as tf

# Object detection imports
from utils import backbone
from api import object_counting_api

# if tf.__version__ < '1.4.0':
#   raise ImportError('Please upgrade your tensorflow installation to v1.4.* or later!')

input_video = "demovideo.mp4"

# By default I use an "SSD with Mobilenet" model here. See the detection model zoo (https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md) for a list of other models that can be run out-of-the-box with varying speeds and accuracies.
detection_graph, category_index = backbone.set_model('fcc')

#fps = 24 # change it with your input video fps
#width = 640 # change it with your input video width
#height = 352 # change it with your input vide height
fps = 30  # change it with your input video fps
width = 670  # change it with your input video width
height = 360  # change it with your input vide height
is_color_recognition_enabled = 0  # set it to 1 for enabling the color prediction for the detected objects
#roi = 200 # roi line position
roi = 180
deviation = 3  # the constant that represents the object counting area

object_counting_api.cumulative_object_counting_y_axis(
    input_video, detection_graph, category_index, is_color_recognition_enabled,
    fps, width, height, roi, deviation)  # counting all the objects
Exemple #4
0
import tensorflow as tf

from utils import backbone
from api import object_counting_api

input_video = "./input_images_and_videos/object_test.mp4"

detection_graph, category_index = backbone.set_model(
    'ssd_mobilenet_v1_coco_2018_01_28', 'mscoco_label_map.pbtxt')

is_color_recognition_enabled = 0
roi = 185
deviation = 2

object_counting_api.cumulative_object_counting_y_axis(
    input_video, detection_graph, category_index, is_color_recognition_enabled,
    roi, deviation)

#object_counting_api.object_counting_webcam(detection_graph, category_index, is_color_recognition_enabled)