ZoneMinder / zmeventnotification

Machine Learning powered Secure Websocket & MQTT based ZoneMinder event notification server
408 stars 128 forks source link

adding pre-trained model to the detection sequence ,bypassing 2nd model results. #390

Closed ozgurozc closed 3 years ago

ozgurozc commented 3 years ago

Before you create an issue, please make sure you have read the README. If you are asking about the object detection part, I don't provide support for it unless you've tried hard enough.

Event Server version app:6.1.16, pyzm:0.3.38, ES:6.1.16 , OpenCV:4.5.1-dev

Are you using MLAPI? (Y/N) NO

Question:

I have a set of cameras detecting cars, tracks and persons and alarm to me with zmninja successfully, I had added a yolo4 pre-trained mask detection model and get it worked in zmeventnotification server. Is it possible to add two models under object section of objectconfig.ini? since it is either detecting person or detecting mask ,when I am running the model it is always bypassing the results of mask detection eventough it is successfully detecting. Is it possible to write the results of two models in the same objdetect.jpg and object.json file like it is doing with object, face and Alpr. I had tried the "union" as same_model_strategy but did not worked.

Below I had managed to run the two models in the same detection sequence . objectconfigini.txt

Below you can see the result debug_match_detection_results_with_person_witout_mask_detection_results.txt

Below you can see the the successful writing of mask detection results when I disabled the yolo4 object detection. debug_mask_detection_results_to_json.txt

pliablepixels commented 3 years ago

Yup, cool use-case. I'd love to see some pictures if possible Use the new union value in same_model_strategy

See https://github.com/pliablepixels/zmeventnotification/blob/ff4c0b5e23f3ebae0c14e67aa02980b5993686b0/hook/objectconfig.ini#L451

If you are not part of the ZM slack channel, would be great if you could join - love to hear more of what you are doing/use-case

pliablepixels commented 3 years ago

app:6.1.16, pyzm:0.3.38, ES:6.1.16 is old. You will need to update to latest versions to use union.

ozgurozc commented 3 years ago

Thank you for your reply , I had been mastering your notification server quite a while in the pandemic lockdown times , loved the way it is coded, It is great job.

pliablepixels commented 3 years ago

https://join.slack.com/t/zoneminder-chat/shared_invite/enQtNTU0NDkxMDM5NDQwLTdhZmQ5Y2M2NWQyN2JkYTBiN2ZkMzIzZGQ0MDliMTRmM2FjZWRlYzUwYTQ2MjMwMTVjMzQ1NjYxOTdmMjE2MTE

ozgurozc commented 3 years ago

Yup, cool use-case. I'd love to see some pictures if possible Use the new union value in same_model_strategy

See

https://github.com/pliablepixels/zmeventnotification/blob/ff4c0b5e23f3ebae0c14e67aa02980b5993686b0/hook/objectconfig.ini#L451

If you are not part of the ZM slack channel, would be great if you could join - love to hear more of what you are doing/use-case

I had joined the slack channel and will love to share details.