|
|
|
@ -83,6 +83,9 @@ def upload(request):
|
|
|
|
if(int(m_class)==2):
|
|
|
|
if(int(m_class)==2):
|
|
|
|
RR = DL.run(weights=(curPath+"/yolov5/yolov5s.pt"), source=img_path, project=(curPath+"/static/detected"))
|
|
|
|
RR = DL.run(weights=(curPath+"/yolov5/yolov5s.pt"), source=img_path, project=(curPath+"/static/detected"))
|
|
|
|
return JsonResponse({'img_name':img_path_res,'code':"【一般物体检测】"+RR+' <br/> '+mesg, 'flag': True})
|
|
|
|
return JsonResponse({'img_name':img_path_res,'code':"【一般物体检测】"+RR+' <br/> '+mesg, 'flag': True})
|
|
|
|
|
|
|
|
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+' <br/> '+mesg, 'flag': True})
|
|
|
|
|
|
|
|
|
|
|
|
def dlurl(request):
|
|
|
|
def dlurl(request):
|
|
|
|
if request.method == 'GET':
|
|
|
|
if request.method == 'GET':
|
|
|
|
@ -132,6 +135,9 @@ def dlurl(request):
|
|
|
|
if(int(m_class)==2):
|
|
|
|
if(int(m_class)==2):
|
|
|
|
RR = DL.run(weights=(curPath+"/yolov5/yolov5s.pt"), source=img_path, project=(curPath+"/static/detected"))
|
|
|
|
RR = DL.run(weights=(curPath+"/yolov5/yolov5s.pt"), source=img_path, project=(curPath+"/static/detected"))
|
|
|
|
return JsonResponse({'img_name':img_path_res,'code':"【一般物体检测】"+RR+' <br/> '+mesg, 'flag': True})
|
|
|
|
return JsonResponse({'img_name':img_path_res,'code':"【一般物体检测】"+RR+' <br/> '+mesg, 'flag': True})
|
|
|
|
|
|
|
|
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+' <br/> '+mesg, 'flag': True})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|