theAIGuysCode / Object-Detection-API

Yolov3 Object Detection implemented as APIs, using TensorFlow and Flask
Apache License 2.0
341 stars 180 forks source link

How to add method when the object was detected ? #16

Open chikow opened 4 years ago

chikow commented 4 years ago

Good morning,

I'm stuck today because I don't know how to add a python method on YoloV3 or YoloV4,

My goal is to trigger an alarm (to send an e-mail for example) when an object will be detected, example:

When my Yolov3 program detects it will send an alert email or a message (sms)

xanthan011 commented 4 years ago

What you can do is instead of sending an alert (sms or mail) u can create a file like log.txt and keep the log(Writing the file) of the detected objected as there might be cases where some irrelevant object/noise is detected and u dont want your phone spammed with those messages.

but if u still want to send an email... try this link:https://www.geeksforgeeks.org/send-mail-gmail-account-using-python/ it has the python program to send email. u can integrate this in the files.

chikow commented 4 years ago

Yes i want to do this but why can i integrate this ? i have .py file which can send mail correctly buy i don't know how to execute the file when it detect object

xanthan011 commented 4 years ago

U can write the write that code (of mail generation) into a function in the same file. So now u can import that function from that file and use it. Eg.. If the name of your file is filename and u named the function as func. So do this in the file u want to integrate.. from filename import func

and use the function like func() or func(parameters)