From ad3cc51f682740a53c348632651f39e9d3197d10 Mon Sep 17 00:00:00 2001 From: wangchunlin Date: Fri, 3 Mar 2023 14:19:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E5=A4=96=E7=A0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- learn/views.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/learn/views.py b/learn/views.py index e11655b..833e24a 100644 --- a/learn/views.py +++ b/learn/views.py @@ -86,6 +86,10 @@ def upload(request): if(int(m_class)==3): RR = DL.run(weights=(curPath+"/yolov5/fire_smoke_towercrane.pt"), source=img_path, project=(curPath+"/static/detected")) return JsonResponse({'img_name':img_path_res,'code':"【烟火+塔吊】"+RR+'
'+mesg, 'flag': True}) + if(int(m_class)==4): + RR = DL.run(weights=(curPath+"/yolov5/vehicle_4class_ljp.pt"), source=img_path, project=(curPath+"/static/detected")) + return JsonResponse({'img_name':img_path_res,'code':"【外破四类】"+RR+'
'+mesg, 'flag': True}) + def dlurl(request): if request.method == 'GET': @@ -138,6 +142,9 @@ def dlurl(request): if(int(m_class)==3): RR = DL.run(weights=(curPath+"/yolov5/fire_smoke_towercrane.pt"), source=img_path, project=(curPath+"/static/detected")) return JsonResponse({'img_name':img_path_res,'code':"【烟火+塔吊】"+RR+'
'+mesg, 'flag': True}) + if(int(m_class)==4): + RR = DL.run(weights=(curPath+"/yolov5/vehicle_4class_ljp.pt"), source=img_path, project=(curPath+"/static/detected")) + return JsonResponse({'img_name':img_path_res,'code':"【外破四类】"+RR+'
'+mesg, 'flag': True})