main python

parent 90f9f6a3
from fastapi import FastAPI,UploadFile,File
import shutil
import model
from pipeline import pipeline
app = FastAPI()
@app.get("/")
def write_home():
return {
"version":"0.1"
}
@app.post("/predict")
async def predict(file: UploadFile = File(...)):
print('******************************************')
with open(f'input\{file.filename}',"wb") as buffer:
shutil.copyfileobj(file.file,buffer)
output_file = pipeline(f'input\{file.filename}',"output/")
return {
"Ouput File":output_file
}
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