From 35cc4221a12052c6fd3da1d69ff16d30e086f4ae Mon Sep 17 00:00:00 2001 From: niten Date: Mon, 9 Jan 2023 10:29:03 -0800 Subject: [PATCH] Give parameter a better name: image --- src/objectifier.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/objectifier.py b/src/objectifier.py index 41ab54c..8e021ef 100644 --- a/src/objectifier.py +++ b/src/objectifier.py @@ -110,14 +110,14 @@ def result_to_dict(res, base_url): # return result_to_dict(result, base_url) @app.post("/images") -def analyze_image(request: Request, incoming_data: bytes = File()): +def analyze_image(request: Request, image: bytes = File()): print("Initiating file receipt, url: " + str(request.url)) base_url = re.sub(r'\/images\/$', '/analyzed_images/', str(request.url)) infile = open(incoming_dir / file.filename) file_hash = hashlib.sha256() - file_hash.update(incoming_data) + file_hash.update(image) with open(infile, "w") as f: - f.write(incoming_data) + f.write(image) print("save complete") print("analyzing image") result = detector.detect_objects(infile, file_hash.hexdigest() + ".png")