from fastapi import FastAPI, HTTPException
from fastapi.responses import JSONResponse
from pydantic import BaseModel

from .model import MobileNetImplementation

class RequestBody(BaseModel):
    url:str

app = FastAPI()
model = MobileNetImplementation()

@app.get("/")
def read_root():
    return {"message":"hello worlds this is something to connect stuff"}

@app.put("/predict")
def predict(content:RequestBody):
    result = model.predict_image(content.url)
    if result:
        return JSONResponse(content=result)
    else:
        raise  HTTPException(status_code=404,detail="Not able to load image from url")
b426a015727d421f591da54c7f5f9c76f6bbf94f
<mask token>


class RequestBody(BaseModel):
    url: str


<mask token>


@app.get('/')
def read_root():
    return {'message': 'hello worlds this is something to connect stuff'}


<mask token>

<mask token>


class RequestBody(BaseModel):
    url: str


<mask token>


@app.get('/')
def read_root():
    return {'message': 'hello worlds this is something to connect stuff'}


@app.put('/predict')
def predict(content: RequestBody):
    result = model.predict_image(content.url)
    if result:
        return JSONResponse(content=result)
    else:
        raise HTTPException(status_code=404, detail=
            'Not able to load image from url')

<mask token>


class RequestBody(BaseModel):
    url: str


app = FastAPI()
model = MobileNetImplementation()


@app.get('/')
def read_root():
    return {'message': 'hello worlds this is something to connect stuff'}


@app.put('/predict')
def predict(content: RequestBody):
    result = model.predict_image(content.url)
    if result:
        return JSONResponse(content=result)
    else:
        raise HTTPException(status_code=404, detail=
            'Not able to load image from url')

from fastapi import FastAPI, HTTPException
from fastapi.responses import JSONResponse
from pydantic import BaseModel
from .model import MobileNetImplementation


class RequestBody(BaseModel):
    url: str


app = FastAPI()
model = MobileNetImplementation()


@app.get('/')
def read_root():
    return {'message': 'hello worlds this is something to connect stuff'}


@app.put('/predict')
def predict(content: RequestBody):
    result = model.predict_image(content.url)
    if result:
        return JSONResponse(content=result)
    else:
        raise HTTPException(status_code=404, detail=
            'Not able to load image from url')

from fastapi import FastAPI, HTTPException
from fastapi.responses import JSONResponse
from pydantic import BaseModel

from .model import MobileNetImplementation

class RequestBody(BaseModel):
    url:str

app = FastAPI()
model = MobileNetImplementation()

@app.get("/")
def read_root():
    return {"message":"hello worlds this is something to connect stuff"}

@app.put("/predict")
def predict(content:RequestBody):
    result = model.predict_image(content.url)
    if result:
        return JSONResponse(content=result)
    else:
        raise  HTTPException(status_code=404,detail="Not able to load image from url")