Spaces:
Runtime error
Runtime error
from fastapi import FastAPI, Form | |
from typing import List | |
from pydantic import BaseModel | |
from src.model import similarity_model as model | |
from src.similarity.similarity import Similarity | |
app = FastAPI() | |
similarity = Similarity() | |
models = similarity.get_models() | |
class ImageInputs(BaseModel): | |
img_main: str | |
img_1: str | |
img_2: str | |
model_idx: int | |
async def check_similarity(images: ImageInputs): | |
result = similarity.check_similarity([images.img_main, images.img_1, images.img_2], models[images.model_idx]) | |
return {"result": result} | |