如何将 yolo 检测到的图像/对象发送到邮件或短信中?

问题描述 投票:0回答:0

出于好奇,我正在尝试构建一个项目对象检测,如果闭路电视检测到一个人,它可以通知我。

有人试过这个吗?

import telebot

# Replace 'YOUR_TELEGRAM_BOT_TOKEN' with your actual bot token
bot = telebot.TeleBot('YOUR_TELEGRAM_BOT_TOKEN')

def send_image(image_path):
    with open(image_path, 'rb') as f:
        # Replace 'YOUR_TELEGRAM_CHAT_ID' with the actual chat ID where you want to send the image
        bot.send_photo('YOUR_TELEGRAM_CHAT_ID', f)

# After detecting an object with YOLO, call the 'send_image' function with the path of the detected image
send_image('path/to/detected/image.jpg')

==============

import discord

# Replace 'YOUR_DISCORD_BOT_TOKEN' with your actual bot token
client = discord.Client()
bot_token = 'YOUR_DISCORD_BOT_TOKEN'

async def send_image(image_path):
    # Replace 'YOUR_DISCORD_CHANNEL_ID' with the actual channel ID where you want to send the image
    channel = client.get_channel('YOUR_DISCORD_CHANNEL_ID')
    with open(image_path, 'rb') as f:
        image = discord.File(f)
        await channel.send(file=image)

# After detecting an object with YOLO, call the 'send_image' function with the path of the detected image
await send_image('path/to/detected/image.jpg')

============

email sms detection yolo
© www.soinside.com 2019 - 2024. All rights reserved.