2023-08-29 09:58:00 -04:00
|
|
|
from enum import StrEnum
|
2023-06-24 23:18:09 -04:00
|
|
|
|
2023-06-05 10:40:48 -04:00
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
|
|
|
|
|
|
def to_lower_camel(string: str) -> str:
|
2023-06-27 19:21:33 -04:00
|
|
|
tokens = [token.capitalize() if i > 0 else token for i, token in enumerate(string.split("_"))]
|
2023-06-05 10:40:48 -04:00
|
|
|
return "".join(tokens)
|
|
|
|
|
|
|
|
|
|
|
|
class TextModelRequest(BaseModel):
|
|
|
|
text: str
|
|
|
|
|
|
|
|
|
|
|
|
class TextResponse(BaseModel):
|
|
|
|
__root__: str
|
|
|
|
|
|
|
|
|
|
|
|
class MessageResponse(BaseModel):
|
|
|
|
message: str
|
|
|
|
|
|
|
|
|
|
|
|
class BoundingBox(BaseModel):
|
|
|
|
x1: int
|
|
|
|
y1: int
|
|
|
|
x2: int
|
|
|
|
y2: int
|
|
|
|
|
|
|
|
|
2023-08-29 09:58:00 -04:00
|
|
|
class ModelType(StrEnum):
|
2023-06-24 23:18:09 -04:00
|
|
|
IMAGE_CLASSIFICATION = "image-classification"
|
|
|
|
CLIP = "clip"
|
|
|
|
FACIAL_RECOGNITION = "facial-recognition"
|