Update main.py

parent dfac6c59
...@@ -32,7 +32,7 @@ app.add_middleware( ...@@ -32,7 +32,7 @@ app.add_middleware(
allow_headers = headers allow_headers = headers
) )
model_dir = "Fish_identificaton.h5" #model_dir = "Fish_identificaton.h5"
model = load_model(model_dir) model = load_model(model_dir)
# Providing the folder path # Providing the folder path
...@@ -57,14 +57,14 @@ model = load_model(model_dir) ...@@ -57,14 +57,14 @@ model = load_model(model_dir)
# # origin = image_link # # origin = image_link
# # ) # # )
def get_net_image_prediction(): #def get_net_image_prediction():
# myfile = open('C:/xampp/htdocs/templates/php/files/fishimage.jpg') # myfile = open('C:/xampp/htdocs/templates/php/files/fishimage.jpg')
# myfile = open('C:\\xampp\\htdocs\\templates\\php\\files\\fishimage.jpg','r') # myfile = open('C:\\xampp\\htdocs\\templates\\php\\files\\fishimage.jpg','r')
shutil.copy(origin,target) shutil.copy(origin,target)
shutil.copy(origin,target2) shutil.copy(origin,target2)
img_path = "fishimage.jpg" #img_path = "fishimage.jpg"
img = load_img( img = load_img(
img_path, img_path,
...@@ -94,7 +94,7 @@ templates = Jinja2Templates(directory="templates") ...@@ -94,7 +94,7 @@ templates = Jinja2Templates(directory="templates")
@app.get("/") @app.get("/")
async def root(): async def root():
return {"message": "Welcome to the Fish Identifications API!"} # return {"message": "Welcome to the Fish Identifications API!"}
# @app.post("/net/image/prediction/") # @app.post("/net/image/prediction/")
...@@ -109,7 +109,7 @@ async def send_image_get_prediction(request: Request): ...@@ -109,7 +109,7 @@ async def send_image_get_prediction(request: Request):
rtt = get_net_image_prediction() rtt = get_net_image_prediction()
return templates.TemplateResponse("Saveimage.html", {"request": request, "variable": rtt}) # return templates.TemplateResponse("Saveimage.html", {"request": request, "variable": rtt})
# async def send_image_get_prediction(): # async def send_image_get_prediction():
......
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