PaddleDetection算法分析(4)

本文是2021SC@SDUSC活动的一部分,深入剖析PaddleDetection中的YOLOv3算法。介绍了yolo_boxes_and_scores()函数如何计算目标框、得分和类别,以及yolo_head()和yolo_correct_boxes()的作用,展示了完整的流程图。最后预告将分析人脸检测模型算法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

2021SC@SDUSC

接上篇

run yolo_video.py
 
def detect_img(yolo):
    while True:
        img = input('Input image filename:')   #输入一张图片
        try:
            image = Image.open(img)
        except:
            print('Open Error! Try again!')
            continue
        else:
            r_image = yolo.detect_image(image)  #进入yolo.detect_image 进行检测
            r_image.show()
    yolo.close_session()
 
 
detect_image()函数在yolo.py第102行
 
    def detect_image(self, image):
        start = timer()
 
        if self.model_image_size != (None, None):  #判断图片是否存在
            assert self.model_image_size[0]%32 == 0, 'Multiples of 32 required'  
            assert self.model_image_size[1]%32 == 0, 'Multiples of 32 required'
            #assert断言语句的语法格式 model_image_size[0][1]指图像的w和h,且必须是32的整数倍
 
            boxed_image = letterbox_
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值