ok I'm at a loss, it still won't use tiny. If I manually edit yolo.py and force it to run tiny_weights it works fine.
I'm running this command :
Code: Select all
sudo -u www-data /usr/bin/detect.py -c /etc/zm/objectconfig.ini -e 46495 -m 16
This is the objectconfig.ini file :
Code: Select all
# Configuration file for object detection
# NOTE: ALL parameters here can be overriden
# on a per monitor basis if you want. Just
# duplicate it inside the correct [monitor-<num>] section
[general]
portal=https://*****/zm
user=*****
password=*****
allow_self_signed=yes
#yolo_type=full
yolo_type=tiny
# if yes, last detection will be stored for monitors
# and bounding boxes that match, along with labels
# will be discarded for new detections. This may be helpful
# in getting rid of static objects that get detected
# due to some motion.
#match_past_detections=yes
match_past_detections=no
# sequence of models to run for detection
models=yolo
# if all, then we will loop through all models
# if first then the first success will break out
detection_mode=first
# If you need basic auth to access ZM
#basic_user=user
#basic_password=password
# path to store downloaded images
# needs to be RW www-data/apache
image_path=/var/lib/zmeventnotification/images
# this is the global detection pattern used for all monitors.
# choose any set of classes from here https://github.com/pjreddie/darknet/blob/master/data/coco.names
# for everything, make it .*
#detect_pattern=(person|car|motorbike|bus|truck|boat)
detect_pattern=.*
# global settings for
# bestmatch, alarm, snapshot OR a specific frame ID
frame_id=bestmatch
# this is the to resize the image before analysis is done
resize=1200
# set to yes, if you want to remove images after analysis
# setting to yes is recommended to avoid filling up space
# keep to no while debugging/inspecting masks
# Note this does NOT delete debug images later
delete_after_analyze=no
# If yes, will write an image called <filename>-bbox.jpg as well
# which contains the bounding boxes. This has NO relation to
# write_image_to_zm
# Typically, if you enable delete_after_analyze you may
# also want to set write_debug_image to no.
write_debug_image=no
# if yes, will write an image with bounding boxes
# this needs to be yes to be able to write a bounding box
# image to ZoneMinder that is visible from its console
write_image_to_zm=yes
# Adds percentage to detections
# hog/face shows 100% always
show_percent=yes
# log level can be info,error,debug
log_level=debug
# color to be used to draw the polygons you specified
poly_color=(255,255,255)
import_zm_zones=no
## Monitor specific settings
#
# - Format: [monitor-<mid>]
#
# Parameters:
# polygon areas where object detection will be done.
# You can name them anything except the keywords defined in the optional
# params below. You can put as many polygons as you want per [monitor-<mid>]
# (see examples).
#
# detect_pattern: overrides the detection patterns used for this monitor.
#
# Examples:
# config files for yolo
[yolo]
config=/var/lib/zmeventnotification/models/yolov3/yolov3.cfg
weights=/var/lib/zmeventnotification/models/yolov3/yolov3.weights
labels=/var/lib/zmeventnotification/models/yolov3/yolov3_classes.txt
tiny_config=/var/lib/zmeventnotification/models/tinyyolo/yolov3-tiny.cfg
tiny_weights=/var/lib/zmeventnotification/models/tinyyolo/yolov3-tiny.weights
tiny_labels=/var/lib/zmeventnotification/models/tinyyolo/yolov3-tiny.txt
# config params for HOG
[hog]
stride=(4,4)
padding=(8,8)
scale=1.05
mean_shift=-1
[face]
known_images_path=/var/lib/zmeventnotification/known_faces
# read https://github.com/ageitgey/face_recognition/wiki/Face-Recognition-Accuracy-Problems
# read https://github.com/ageitgey/face_recognition#automatically-find-all-the-faces-in-an-image
# and play around
# quick overview:
# num_jitters is how many times to distort images
# upsample_times is how many times to upsample input images (for small faces, for example)
# model can be hog or cnn. cnn may be more accurate, but I haven't found it to be
face_num_jitters=1
face_model=hog
face_upsample_times=1
[alpr]
alpr_use_after_detection_only=yes
# -----| If you are using plate recognizer | ------
#alpr_service=plate_recognizer
# If you want to host a local SDK https://app.platerecognizer.com/sdk/
#alpr_url=https://localhost:8080
# Plate recog replace with your api key
#alpr_key=__PLATERECOG_KEY__
# if yes, then it will log usage statistics of the ALPR service
platerec_stats=no
# If you want to specify regions. See http://docs.platerecognizer.com/#regions-supported
#platerec_regions=['us','cn','kr']
# minimal confidence for actually detecting a plate
platerec_min_dscore=0.1
# minimal confidence for the translated text
platerec_min_score=0.2
# ----| If you are using openALPR |-----
alpr_service=open_alpr
alpr_key=__OPENALPR_SECRET__
# For an explanation of params, see http://doc.openalpr.com/api/?api=cloudapi
openalpr_recognize_vehicle=1
#openalpr_country=us
#openalpr_state=ca
# openalpr returns percents, but we convert to between 0 and 1
openalpr_min_confidence=0.3
This is the entry in syslog that corresponds :
Code: Select all
Jul 14 14:50:48 localhost detect:[5313][monitor_m16]: INFO [---------| app version: 3.3.5 |------------]
Jul 14 14:50:48 localhost detect:[5313][monitor_m16]: INFO [Log level set to:debug]
Jul 14 14:50:48 localhost detect:[5313][monitor_m16]: DEBUG [allowing self-signed certs to work...]
Jul 14 14:50:48 localhost detect:[5313][monitor_m16]: DEBUG [Trying to download https:/****/zm/index.php?view=image&eid=46495&fid=alarm&username=**&password=*****]
Jul 14 14:50:48 localhost detect:[5313][monitor_m16]: DEBUG [Trying to download https://****/zm/index.php?view=image&eid=46495&fid=snapshot&username=**&password=*****]
Jul 14 14:50:49 localhost detect:[5313][monitor_m16]: DEBUG [No polygon area specfied, so adding a full image polygon:[{'name': 'full_image', 'value': [(0, 0), (640, 0), (640, 480), (0, 480)]}]]
Jul 14 14:50:49 localhost detect:[5313][monitor_m16]: DEBUG [resizing to 1200 before analysis...]
Jul 14 14:50:49 localhost detect:[5313][monitor_m16]: DEBUG [resized polygons x=1.0/y=1.0: [{'name': 'full_image', 'value': [(0, 0), (640, 0), (640, 480), (0, 480)]}]]
Jul 14 14:50:49 localhost detect:[5313][monitor_m16]: DEBUG [User ALPR if vehicle found: False]
Jul 14 14:50:49 localhost detect:[5313][monitor_m16]: DEBUG [|--> model:yolo init took: 0.000175s]
Jul 14 14:50:49 localhost detect:[5313][monitor_m16]: DEBUG [Using model: yolo with /var/lib/zmeventnotification/images/46495-alarm.jpg]
Jul 14 14:50:50 localhost detect:[5313][monitor_m16]: DEBUG [Initializing Yolo]
Jul 14 14:50:50 localhost detect:[5313][monitor_m16]: DEBUG [config:/var/lib/zmeventnotification/models/yolov3/yolov3.cfg, weights:/var/lib/zmeventnotification/models/yolov3/yolov3.weights]
Jul 14 14:51:17 localhost detect:[5313][monitor_m16]: DEBUG [|--> model:yolo detection took: 27.736631s]
Jul 14 14:51:17 localhost detect:[5313][monitor_m16]: DEBUG [ALPR not in use, no need for look aheads in processing]
Jul 14 14:51:17 localhost detect:[5313][monitor_m16]: DEBUG [No match found in /var/lib/zmeventnotification/images/46495-alarm.jpg using model:yolo]
Jul 14 14:51:17 localhost detect:[5313][monitor_m16]: DEBUG [Using model: yolo with /var/lib/zmeventnotification/images/46495-snapshot.jpg]
Jul 14 14:51:43 localhost detect:[5313][monitor_m16]: DEBUG [|--> model:yolo detection took: 26.390611s]
Jul 14 14:51:43 localhost detect:[5313][monitor_m16]: DEBUG [ALPR not in use, no need for look aheads in processing]
Jul 14 14:51:43 localhost detect:[5313][monitor_m16]: DEBUG [No match found in /var/lib/zmeventnotification/images/46495-snapshot.jpg using model:yolo]
Jul 14 14:51:43 localhost detect:[5313][monitor_m16]: DEBUG [No patterns found using any models in all files]