Spaces:
Runtime error
Runtime error
rohithk-03
commited on
Commit
·
0a796a0
1
Parent(s):
6290f24
update model code
Browse files
app.py
CHANGED
@@ -23,6 +23,8 @@ GDRIVE_MODEL_URL = "https://drive.google.com/uc?id=1fzKneepaRt_--dzamTcDBM-9d3_d
|
|
23 |
LOCAL_MODEL_PATH = "checkpoint32.pth"
|
24 |
|
25 |
print(GDRIVE_MODEL_URL)
|
|
|
|
|
26 |
def download_file_from_google_drive():
|
27 |
gdown.download(GDRIVE_MODEL_URL, LOCAL_MODEL_PATH, quiet=False)
|
28 |
|
@@ -227,7 +229,7 @@ def predict():
|
|
227 |
if file.filename.lower().endswith((".png", ".jpg", ".jpeg")):
|
228 |
image = Image.open(temp_path)
|
229 |
image_save_path = os.path.join(
|
230 |
-
tempfile.gettempdir(),
|
231 |
image.save(image_save_path)
|
232 |
|
233 |
return jsonify({"message": model.check_file(temp_path), "saved_path": image_save_path})
|
|
|
23 |
LOCAL_MODEL_PATH = "checkpoint32.pth"
|
24 |
|
25 |
print(GDRIVE_MODEL_URL)
|
26 |
+
|
27 |
+
|
28 |
def download_file_from_google_drive():
|
29 |
gdown.download(GDRIVE_MODEL_URL, LOCAL_MODEL_PATH, quiet=False)
|
30 |
|
|
|
229 |
if file.filename.lower().endswith((".png", ".jpg", ".jpeg")):
|
230 |
image = Image.open(temp_path)
|
231 |
image_save_path = os.path.join(
|
232 |
+
tempfile.gettempdir(), file.filename.lower())
|
233 |
image.save(image_save_path)
|
234 |
|
235 |
return jsonify({"message": model.check_file(temp_path), "saved_path": image_save_path})
|