0
votes

I have orientation corrector class in seperate python file which takes rotated image and logo based on logo location it rotates image to correct orientation.

Now I am calling this class in fastapi but I am getting de


from orientation_corrector import OrientationCorrector
from fastapi import FastAPI
from fastapi import FastAPI, File, UploadFile
import uvicorn

app = FastAPI()


app.post('/image')
async def orientation_corrector_image(file1: UploadFile = File("assets\rotated_marks.png"),
                                      file2: UploadFile = File("src\configs\Logo.json")):
    image = (await file1.read())
    logo = (await file2.read())
    print(image)
    print(logo)
    result=OrientationCorrector(image,logo)
    return result

if __name__ == "__main__":
    uvicorn.run(app, debug=True)```
1
What error are you getting? What did you expect to happen and what happened?MatsLindh
Please add at least the request you have made.rcepre

1 Answers

0
votes
from orientation_corrector import OrientationCorrector
from fastapi import FastAPI
from fastapi import FastAPI, File, UploadFile
import uvicorn

app = FastAPI()

app.post('/image')
async def orientation_corrector_image(file1: UploadFile = File("assets\rotated_marks.png"),
                                      file2: UploadFile = File("src\configs\Logo.json")):
    result = await OrientationCorrector(file1.read(), file2.read())
    return result

if __name__ == "__main__":
    uvicorn.run(app, debug=True)