首页 > 编程知识 正文

BVS安全帽识别系统,安全帽识别算法

时间:2023-05-06 19:30:31 阅读:10325 作者:2872

最近进行了一个新项目。 必须识别照片和视频中的人是否戴头盔,并在网站上进行查看.演示

首先是常规登录注册

defmy_login(request ) : if request.method==' get ' : return render ) request, ' auth/auth.html ' (else : form=loginform (request.post ) if form.is_valid ) ) : username=form.cleaned password=. get ) if next 3360 next _ URL=(next ) 360 else : next _ URL=' ' user=authenticate (请求,username=username,PPE ) user ) request.session.set _ expiry (none ) data={ ' next _ URL ' : next _ URL } return rest ful.result } data=

目前登录注册有很多方式,这很常见,因为注册了用户名密码,也没有写复杂的事情。

接下来是主要功能页面

识别码的一部分:

whilevid.isopened(:_q,image=vid.read ) frame_id =1 t1=time.time ) ) image_h,image_w, _=image.shape bbox _ thick=int (1.5 * (image _ himage _ w )/600 ) person_box,helmet_box, boxes=t.detect_image(image ) person_box=utils.xyxy2xywh ) person_box ) features=encoder ) image,person fowh features () boxes=NP.array (d.tlwhfordindetections ) (Scores=NP.Array ) (d.confidencefordindetections ) ) ) indices=preprocessing.non _ max _ suppression (boxes,nms_max_overlap,scores (detections [ I ] ) tracker.update(detections,frame_id ) if len (tracker.lossed ) 0: pass for id, trackinenumerate (tracker.tracks ) : if not track.is_confirmed ) or track.time _ since _ u u u update 13360 continue bobok book CK (int ) Bbox[0],int(Bbox[1] ),0,0.0015 * image _ h,) 0,255,0 ),bbox _ thick//2(if track.is ) ) (int ) Bbox(0) Bbox(0)/2,int ) Bbox(0) ),0,0.0012 * image _ h,) 0,0,0, 255 )、box _ thick//2(no _ hat=1else : if track.helmetisnotnone : bbox=track.helmet cv2. rectangle ) image 0.0012 * image_h,(0,0,255 ),bbox_thick //2) for i,) x,y ) in enumerate (track.tracker _ path (13333365360 pm int ) pre_v ) ),int ) ) x ), int ) (y ) ) )、image ) fps=(fps(1./) time.time )- t1 ) )/2 if cv2.waitKey(1)1)0xff==ord ) '。 ifcv2.waitkey(1)==27:#break#print(no_hat ),no_hat ) ) ) )

如上图所示,可以识别图像和视频

上传照片,

正在识别中

识别码使用tensorflow opencv,识别结果一般。

具体效果

这个项目完全有啊。 然后上传到了面包上。 需要的东西可以下载,送到门口。 https://mianbao duo.com/o/bread/yziuljht

或qq1527507926

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。