Commit 480d7084 authored by Ubuntu's avatar Ubuntu
Browse files

Added dummy file to push folder and fixed folder not being created on temp image file save

parent 66498a81
...@@ -178,7 +178,9 @@ def predict_output (image): ...@@ -178,7 +178,9 @@ def predict_output (image):
Generate json output object Generate json output object
""" """
_output = [] _output = []
temp_path = os.path.join(ROOT_DIR, 'temp_inception')
os.makedirs(temp_path, exist_ok=True)
temp_image_file = os.path.join(temp_path, 'tmp.jpg')
for _idx, class_id in enumerate(p["class_ids"]): # Traverse through all identified individual instances of classes for _idx, class_id in enumerate(p["class_ids"]): # Traverse through all identified individual instances of classes
polygon = [] polygon = []
...@@ -206,11 +208,10 @@ def predict_output (image): ...@@ -206,11 +208,10 @@ def predict_output (image):
image_cropped = image[x0:x0+width, y0:y0+height, :] image_cropped = image[x0:x0+width, y0:y0+height, :]
im = Image.fromarray(image_cropped) im = Image.fromarray(image_cropped)
src=os.path.join(ROOT_DIR, 'temp_inception/tmp.jpg') im.save(temp_image_file)
im.save(src) label, score = runt(temp_image_file, labels, input_layer, output_layer)
label, score = runt(src,labels,input_layer,output_layer)
# barcoded = run_barcoded(src, model_barcoded) # barcoded = run_barcoded(src, model_barcoded)
os.remove(src) os.remove(temp_image_file)
_result = {} _result = {}
_result["image_id"] = "?" _result["image_id"] = "?"
......
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