Spaces:
Sleeping
Sleeping
from fastapi import FastAPI, File, UploadFile | |
from fastapi.staticfiles import StaticFiles | |
from fastapi.responses import FileResponse | |
from PIL import Image | |
import numpy as np | |
import urllib.request | |
import io | |
import os | |
from moviepyTest import test | |
app = FastAPI() | |
def inference(): | |
return "<p>Hello, World!</p>" | |
def t5(input): | |
return {"output": input} | |
def t5(): | |
result = test() | |
return {"output": result} | |
async def getCoordinates(image: UploadFile = File(...)): | |
img = await image.read() | |
image = Image.open(io.BytesIO(img)).convert("L").convert("RGB") | |
path_to_image = "save.jpg" | |
image.save(path_to_image) | |
return "获取图片保存成功" |