改为在之前插入

main
wangchunlin 4 years ago
parent ec7a604a17
commit 20795620e1

@ -29,7 +29,7 @@
</select>
</div>
<p id="img"></p>
<script>
function GetImgfromClip()
{
@ -68,11 +68,15 @@ document.addEventListener("paste", function () {
}
};
}
$("body").append('<br>' +'<br>' + '<b>'+'<font size="4">'+"检测图片:"+res.code+'</font> '+"</b>"+'<br>');
document.body.appendChild(i);//将后端返回的图片加入到页面中
$("#img").prepend(i);
$("#img").prepend('<br>' +'<br>' + '<b>'+'<font size="4">'+"检测图片:"+res.code+'</font> '+"</b>"+'<br>');
})
}
//var h = $(document).height()-$(window).height();
// var h = $(document).height();
// setTimeout(function(){
// $(document).scrollTop(h);
// },1000); //由于使用了从前往后的插入,就不需要跳转
});
</script>
<script>
@ -108,8 +112,8 @@ layui.use('upload', function(){
}
};
}
$("body").append('<br>' +'<br>' + '<b>'+'<font size="4">'+"检测图片:"+res.code+'</font> '+"</b>"+'<br>');
document.body.appendChild(i);//将后端返回的图片加入到页面中
$("#img").prepend(i);
$("#img").prepend('<br>' +'<br>' + '<b>'+'<font size="4">'+"检测图片:"+res.code+'</font> '+"</b>"+'<br>');
}
,error: function(){
//请求异常回调

@ -23,12 +23,8 @@ def upload(request):
for i in file.chunks():
f.write(i)
f.close()
RR = DL.run(weights=(curPath+"/yolov5/yolov5s.pt"), source=img_path, project=(curPath+"/static/detected"))
res = 1
if(res == 1):
return JsonResponse({'img_name':img_path_res,'code':RR})
else:
return JsonResponse({'img_name':img_path_res,'code':RR})
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})
def dlurl(request):
if request.method == 'GET':

Loading…
Cancel
Save