-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathschemas.py
108 lines (84 loc) · 1.89 KB
/
schemas.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
from datetime import datetime
from typing import List, Optional, Dict, Union
from pydantic import BaseModel
from sqlalchemy import TIMESTAMP, true
# Item Models
class ItemBase(BaseModel):
title: str
description: Optional[str] = None
class ItemCreate(ItemBase):
pass
class Item(ItemBase):
id: int
owner_id: int
class Config:
orm_mode = True
# User Models
class UserBase(BaseModel):
email: str
class UserCreate(UserBase):
password: str
class User(UserBase):
id: int
is_active: bool
items: List[Item] = []
class Config:
orm_mode = True
# Message Models
class MessageCreate(BaseModel):
text: str
sender_id: int
recipient_id: int
class Message(BaseModel):
id: int
text: str
time: datetime = datetime.now()
sender_id: int
recipient_id: int
class Config:
orm_mode = True
#---------------------------------------------------------
class CreateOpt(BaseModel):
output_dir: str
num_to_draw: int
final_nms_thresh: float
use_cudnn: int
text_size: int
max_images: int
gpu: int
splits_json: str
vg_img_root_dir: str
checkpoint: str
num_proposals: int
rpn_nms_thresh: float
image_size: int
input_image: str
input_split: str
box_width: int
input_dir: str
output_vis_dir: str
output_vis: int
class CreateResult(BaseModel):
img_name: str
scores: List[float]
captions: List[str]
boxes: List[List[float]]
class DenseCaptionCreate(BaseModel):
opt: CreateOpt
results: List[CreateResult]
class DenseCaptionChild(BaseModel):
id: int
caption: str
score: float
bounding_x: float
bounding_y: float
bounding_w: float
bounding_h: float
parent_id: int
class Config:
orm_mode = True
class DenseCaptionParent(BaseModel):
id: int
imageName: str
class Config:
orm_mode = True