Commit 4396ba50 authored by sleepless-se's avatar sleepless-se
Browse files

stop draw image

parent cd7fde2b
Pipeline #68045069 passed with stage
in 13 minutes and 6 seconds
......@@ -23,9 +23,6 @@ EXCUTION_PATH = '/app'
yolo = YOLO()
graph = tf.get_default_graph()
classes = []
with open('model_data/voc_classes.txt') as f:
classes = f.read().split()
class MyEncoder(json.JSONEncoder):
def default(self, obj):
......@@ -49,11 +46,11 @@ def predict_image(image):
image = image.convert("RGB")
with graph.as_default():
results = yolo.detect_image(image)
import cv2
images = []
for result in results:
images = result['image']
cv2.imwrite("out.jpg", np.asarray(images)[..., ::-1])
# import cv2
# images = []
# for result in results:
# images = result['image']
# cv2.imwrite("out.jpg", np.asarray(images)[..., ::-1])
return results
def return_format(data):
......@@ -87,7 +84,6 @@ def predict():
data = predict_image(data['image'])
data = return_format(data)
data = json.dumps(data, cls=MyEncoder)
print('json',data)
return jsonify(data)
except Exception as e:
print(e)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment