-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
data_definitions.py
44 lines (37 loc) · 1.02 KB
/
data_definitions.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
from dataclasses import dataclass
from typing import List, Optional, Any
@dataclass
class Caption:
caption: str
@dataclass
class Box:
category_name: str
bbox: List[float] # normalized [min_x, min_y, max_x, max_y]
confidence: Optional[float]
is_occluded: Optional[bool]
is_truncated: Optional[bool]
is_group_of: Optional[bool]
is_depiction: Optional[bool]
is_inside: Optional[bool]
@dataclass
class Context:
sample_id: str
source: str
captions: List[Caption]
boxes: Optional[List[Box]] = None
@dataclass
class SampleResponse:
instruction: str
response: str
@dataclass
class Sample:
id: str
instruction: str
response: str
image: str
image_source: str
type: str
{"id": "000000525439", "image": "COCO_val2014_000000525439.jpg",
"instruction": "What is the position of the skateboard in the image?",
"output": "The skateboard in the image is in an upside-down position, with its wheels pointing up and laying on the ground.",
"type": "conv"}