diff --git a/model.h5:Zone.Identifier b/model.h5:Zone.Identifier new file mode 100644 index 0000000..c793637 --- /dev/null +++ b/model.h5:Zone.Identifier @@ -0,0 +1,4 @@ +[ZoneTransfer] +ZoneId=3 +ReferrerUrl=https://drive.google.com/ +HostUrl=https://drive.usercontent.google.com/download?id=1rTVJGaQwKP2SuB1lp0F9zUVha59J0x6o&export=download&authuser=0 diff --git a/treasurebot/api/main.py b/treasurebot/api/main.py index 67b9249..73f7c1d 100644 --- a/treasurebot/api/main.py +++ b/treasurebot/api/main.py @@ -4,8 +4,6 @@ from treasurebot.ml_logic.registry import get_model from treasurebot.ml_logic.preprocessor import preprocess_image from treasurebot.ml_logic.data import get_picture -import os - # Load environment variables @@ -15,12 +13,8 @@ @app.get("/classify") async def classify_image(): - # Get the directory of the current script - current_dir = os.path.dirname(__file__) - # moving to the root directory - parent_dir = os.path.abspath(os.path.join(current_dir, '..', '..')) - # Construct the path to the 'test.jpg' file - image_path = os.path.join(parent_dir, 'pictures', 'test.jpg') + # Open the image from the upload + image = get_picture('test.jpg') # Preprocess the image using the defined function preprocessed_image = preprocess_image(image_path) diff --git a/treasurebot/ml_logic/registry.py b/treasurebot/ml_logic/registry.py index 6c91dff..f000f02 100644 --- a/treasurebot/ml_logic/registry.py +++ b/treasurebot/ml_logic/registry.py @@ -2,6 +2,7 @@ from treasurebot.params import * from tensorflow.keras.models import load_model + def get_model(): #if MODEL_TARGET == 'local': current_dir = os.path.dirname(__file__)