diff --git a/learn/templates/home.html b/learn/templates/home.html index 61c56d5..a1f24f3 100644 --- a/learn/templates/home.html +++ b/learn/templates/home.html @@ -22,6 +22,7 @@ 小模型 大模型 + 泛模型 火焰与烟雾 diff --git a/learn/views.py b/learn/views.py index 981c4be..83c690e 100644 --- a/learn/views.py +++ b/learn/views.py @@ -30,6 +30,9 @@ def upload(request): if(int(m_model)==2): #大模型 RR = DL.run(weights=(curPath+"/yolov5/v6m6.pt"), source=img_path, imgsz=(1280, 1280), project=(curPath+"/static/detected")) return JsonResponse({'img_name':img_path_res,'code':"【烟火 大模型】"+RR, 'flag': True}) + if(int(m_model)==3): #泛模型 + RR = DL.run(weights=(curPath+"/yolov5/best.pt"), source=img_path, project=(curPath+"/static/detected")) + return JsonResponse({'img_name':img_path_res,'code':"【烟火 泛模型】"+RR, 'flag': True}) if(int(m_class)==2): RR = DL.run(weights=(curPath+"/yolov5/yolov5s.pt"), source=img_path, project=(curPath+"/static/detected")) return JsonResponse({'img_name':img_path_res,'code':"【一般物体检测】"+RR, 'flag': True}) @@ -62,6 +65,9 @@ def dlurl(request): if(int(m_model)==2): #大模型 RR = DL.run(weights=(curPath+"/yolov5/v6m6.pt"), source=img_path, imgsz=(1280, 1280), project=(curPath+"/static/detected")) return JsonResponse({'img_name':img_path_res,'code':"【烟火 大模型】"+RR, 'flag': True}) + if(int(m_model)==3): #泛模型 + RR = DL.run(weights=(curPath+"/yolov5/best.pt"), source=img_path, project=(curPath+"/static/detected")) + return JsonResponse({'img_name':img_path_res,'code':"【烟火 泛模型】"+RR, 'flag': True}) if(int(m_class)==2): RR = DL.run(weights=(curPath+"/yolov5/yolov5s.pt"), source=img_path, project=(curPath+"/static/detected")) return JsonResponse({'img_name':img_path_res,'code':"【一般物体检测】"+RR, 'flag': True}) diff --git a/learn/yolov5 b/learn/yolov5 index db920e0..52ab941 160000 --- a/learn/yolov5 +++ b/learn/yolov5 @@ -1 +1 @@ -Subproject commit db920e09e3becdf7496b9f0a520e02b94c79cf67 +Subproject commit 52ab9417e60e436fbfe93d377a5845bbae78fb51