up log
This commit is contained in:
@ -65,7 +65,7 @@ parser.add_argument('--conf-thres', type=float, default=0.70, help='object confi
|
||||
parser.add_argument('--iou-thres', type=float, default=0.45, help='IOU threshold for NMS')
|
||||
parser.add_argument('--device', default='', help='cuda device, i.e. 0 or 0,1,2,3 or cpu')
|
||||
parser.add_argument('--view-img', type=bool, default=True, help='display results')
|
||||
parser.add_argument('--save-txt', type=bool, default=True, help='save results to *.txt')
|
||||
parser.add_argument('--save-txt', type=bool, default=False, help='save results to *.txt')
|
||||
parser.add_argument('--save-conf', type=bool, default=True, help='save confidences in --save-txt labels')
|
||||
parser.add_argument('--nosave', type=bool, default=True, help='do not save images/videos')
|
||||
parser.add_argument('--classes', nargs='+', type=int, help='filter by class: --class 0, or --class 0 2 3')
|
||||
@ -80,10 +80,10 @@ parser.add_argument('--exist-ok', type=bool, default=True, help='existing projec
|
||||
opt, unknown = parser.parse_known_args()
|
||||
@app.route("/zhanting", methods=['POST'])
|
||||
def get_isempty():
|
||||
#start = time.time()
|
||||
start = time.time()
|
||||
data = request.get_data()
|
||||
ip = request.remote_addr
|
||||
print('------ ip = %s ------' % ip)
|
||||
logger.info(f"client ip:{ip}")
|
||||
|
||||
json_data = json.loads(data.decode("utf-8"))
|
||||
# getdateend = time.time()
|
||||
@ -95,7 +95,7 @@ def get_isempty():
|
||||
}
|
||||
try:
|
||||
imgdata = base64.b64decode(pic)
|
||||
#image_path = 'data/images/1.jpg'
|
||||
#image_path = 'imgs/1.jpg'
|
||||
image_path = '../module/ieemoo-ai-zhanting/imgs/1.jpg'
|
||||
file = open(image_path, 'wb')
|
||||
file.write(imgdata)
|
||||
@ -112,6 +112,7 @@ def get_isempty():
|
||||
pred = detect.detect(opt)
|
||||
logger.info(pred)
|
||||
Obs(image_path)
|
||||
logger.info("all time:%.3fs" % (time.time() - start))
|
||||
#print('pred', pred)
|
||||
#getdateend = time.time()
|
||||
#now_time = datetime.datetime.now()
|
||||
@ -126,6 +127,6 @@ def get_isempty():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host='192.168.1.142', port=8000)
|
||||
app.run(host='192.168.1.142', port=8009)
|
||||
#http_server = WSGIServer(('0.0.0.0', 8000), app)
|
||||
#http_server.serve_forever()
|
||||
|
Reference in New Issue
Block a user