forked from umautobots/GTAVisionExport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
database_schema.sql
200 lines (182 loc) · 4.52 KB
/
database_schema.sql
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
create type detection_type AS ENUM ('background', 'person', 'car', 'bicycle');
create type detection_class AS ENUM ('Unknown', 'Compacts', 'Sedans', 'SUVs', 'Coupes', 'Muscle', 'SportsClassics', 'Sports', 'Super', 'Motorcycles', 'OffRoad', 'Industrial', 'Utility', 'Vans', 'Cycles', 'Boats', 'Helicopters', 'Planes', 'Service', 'Emergency', 'Military', 'Commercial', 'Trains');
create type weather AS ENUM ('Unknown', 'ExtraSunny', 'Clear', 'Clouds', 'Smog', 'Foggy', 'Overcast', 'Raining', 'ThunderStorm', 'Clearing', 'Neutral', 'Snowing', 'Blizzard', 'Snowlight', 'Christmas', 'Halloween');
create table detections
(
detection_id serial not null
constraint detections_pkey
primary key,
snapshot_id integer,
type detection_type,
pos geometry(PointZ),
bbox box,
class detection_class default 'Unknown'::detection_class,
handle integer default '-1'::integer,
best_bbox box,
best_bbox_old box,
bbox3d box3d,
rot geometry,
coverage real default 0.0,
created timestamp without time zone default (now() at time zone 'utc')
)
;
create table runs
(
run_id serial not null
constraint runs_pkey
primary key,
runguid uuid,
archivepath text,
localpath text,
session_id integer default 1,
instance_id integer default 0,
created timestamp without time zone default (now() at time zone 'utc')
)
;
create table sessions
(
session_id serial not null
constraint sessions_pkey
primary key,
name text
constraint sessions_name_key
unique,
start timestamp with time zone,
"end" timestamp with time zone,
created timestamp without time zone default (now() at time zone 'utc')
)
;
alter table runs
add constraint runs_session_fkey
foreign key (session_id) references sessions
on delete cascade
;
create table snapshots
(
snapshot_id serial not null
constraint snapshots_pkey
primary key,
run_id integer
constraint snapshots_run_fkey
references runs
on delete cascade,
version integer,
imagepath text,
timestamp timestamp with time zone,
timeofday time,
currentweather weather,
camera_pos geometry(PointZ),
camera_direction geometry,
camera_fov real,
view_matrix double precision[],
proj_matrix double precision[],
processed boolean default false not null,
width integer,
height integer
)
;
alter table detections
add constraint detections_snapshot_fkey
foreign key (snapshot_id) references snapshots
on delete cascade
;
create table instances
(
instance_id serial not null
constraint isntances_pkey
primary key,
hostname text,
instanceid text
constraint instanceid_uniq
unique,
instancetype text,
publichostname text,
amiid text,
created timestamp without time zone default (now() at time zone 'utc'),
constraint instance_info_uniq
unique (hostname, instanceid, instancetype, publichostname, amiid)
)
;
alter table runs
add constraint runs_instance_fkey
foreign key (instance_id) references instances
;
create table snapshot_weathers
(
weather_id serial not null
constraint snapshot_weathers_pkey
primary key,
snapshot_id integer
constraint snapshot_weathers_snapshot_id_fkey
references snapshots
on delete cascade,
weather_type weather,
snapshot_page integer,
created timestamp without time zone default (now() at time zone 'utc')
)
;
create table uploads
(
id serial not null
constraint uploads_pkey
primary key,
bucket text,
key text,
uploadid text,
created timestamp without time zone default (now() at time zone 'utc')
)
;
create table datasets
(
dataset_id serial not null
constraint datasets_pkey
primary key,
dataset_name text,
view_name text,
created timestamp without time zone default (now() at time zone 'utc')
)
;
create table systems
(
system_uuid uuid not null
constraint systems_pkey
primary key,
vendor text,
dnshostname text,
username text,
systemtype text,
totalmem bigint,
created timestamp without time zone default (now() at time zone 'utc')
)
;
create table system_graphics
(
system_graphic_id serial not null
constraint system_graphics_pkey
primary key,
deviceid text,
adaptercompatibility text,
adapterdactype text,
adapterram integer,
availability integer,
caption text,
description text,
driverdate timestamp with time zone,
driverversion text,
pnpdeviceid text,
name text,
videoarch integer,
memtype integer,
videoprocessor text,
bpp integer,
hrez integer,
vrez integer,
num_colors integer,
cols integer,
rows integer,
refresh integer,
scanmode integer,
videomodedesc text,
created timestamp without time zone default (now() at time zone 'utc')
)
;