- This event has passed.
9 AM – Adv AI and Machine Learning – Gamas
November 7 @ 9:00 am - 10:00 am
Today We Did
- We learned how to display objects detected by glasses_model and coco_model
- We learned how to eliminate code duplication using function.
- We learned how to send an email using code below
-
import smtplib from email.mime.text import MIMEText def send_email(to, subject, content): sender_email = "ENTER YOUR EMAIL HERE" app_password = "ENTER YOUR APP PASSWORD" msg = MIMEText(content, "plain", "utf-8") msg["Subject"] = subject msg["From"] = sender_email msg["To"] = to server = smtplib.SMTP("smtp.gmail.com", 587) server.starttls() server.login(sender_email, app_password) server.send_message(msg) server.quit() if __name__ == '__main__': send_email("ayclogic@gmail.com", "test_subject", "test_content")
-
Homework
- Change two_model_object_detection.py
- import email_tool.py into two_model_object_detection.py
- so when it detect “person” and it has not sent an email, send an email using function we created inside email_tool.py