Datasets:
image imagewidth (px) 127 500 | width int64 127 500 | height int64 71 500 | objects dict |
|---|---|---|---|
500 | 375 | {
"bbox": [
[
262,
210,
62,
129
],
[
164,
263,
89,
109
],
[
4,
243,
63,
131
],
[
240,
193,
55,
106
],
[
276,
185,
36,
35
]
],
"category": [
8,
8,
... | |
500 | 333 | {
"bbox": [
[
140,
49,
360,
281
]
],
"category": [
6
]
} | |
500 | 375 | {
"bbox": [
[
68,
171,
202,
159
],
[
149,
140,
80,
144
],
[
284,
200,
43,
131
],
[
257,
197,
40,
132
]
],
"category": [
12,
14,
14,
14
]
} | |
500 | 333 | {
"bbox": [
[
155,
96,
196,
174
]
],
"category": [
6
]
} | |
334 | 500 | {
"bbox": [
[
91,
71,
214,
402
]
],
"category": [
1
]
} | |
480 | 364 | {
"bbox": [
[
184,
61,
95,
138
],
[
89,
77,
314,
259
]
],
"category": [
14,
12
]
} | |
500 | 375 | {
"bbox": [
[
230,
87,
253,
169
],
[
10,
112,
256,
147
]
],
"category": [
7,
7
]
} | |
375 | 500 | {
"bbox": [
[
32,
147,
339,
269
]
],
"category": [
6
]
} | |
336 | 500 | {
"bbox": [
[
0,
234,
182,
154
],
[
209,
35,
127,
447
],
[
45,
81,
125,
284
],
[
10,
180,
132,
239
]
],
"category": [
11,
14,
14,
14
]
} | |
334 | 500 | {
"bbox": [
[
8,
229,
237,
271
],
[
229,
219,
105,
281
],
[
1,
177,
89,
323
],
[
1,
0,
116,
369
],
[
2,
1,
241,
461
],
[
224,
0,
110,
... | |
500 | 335 | {
"bbox": [
[
195,
164,
294,
83
]
],
"category": [
18
]
} | |
500 | 333 | {
"bbox": [
[
89,
124,
248,
88
]
],
"category": [
6
]
} | |
500 | 375 | {
"bbox": [
[
35,
204,
145,
85
],
[
50,
159,
100,
133
],
[
294,
137,
156,
153
]
],
"category": [
1,
14,
14
]
} | |
500 | 281 | {
"bbox": [
[
103,
77,
272,
106
],
[
132,
87,
65,
36
],
[
194,
179,
19,
50
],
[
25,
188,
19,
50
]
],
"category": [
0,
0,
14,
14
]
} | |
500 | 366 | {
"bbox": [
[
8,
106,
491,
157
],
[
420,
199,
62,
27
],
[
324,
187,
87,
36
]
],
"category": [
0,
0,
0
]
} | |
360 | 500 | {
"bbox": [
[
115,
166,
245,
234
],
[
140,
152,
193,
77
]
],
"category": [
18,
18
]
} | |
500 | 375 | {
"bbox": [
[
0,
95,
191,
266
],
[
217,
97,
248,
221
],
[
467,
194,
33,
123
],
[
2,
303,
498,
72
]
],
"category": [
14,
14,
14,
10
]
} | |
332 | 500 | {
"bbox": [
[
26,
78,
293,
266
]
],
"category": [
11
]
} | |
500 | 375 | {
"bbox": [
[
155,
88,
189,
191
]
],
"category": [
19
]
} | |
500 | 333 | {
"bbox": [
[
362,
46,
70,
61
],
[
215,
91,
92,
211
],
[
163,
147,
64,
97
]
],
"category": [
19,
14,
14
]
} | |
500 | 335 | {
"bbox": [
[
262,
31,
238,
264
],
[
0,
35,
235,
264
]
],
"category": [
18,
18
]
} | |
500 | 333 | {
"bbox": [
[
0,
0,
370,
330
],
[
98,
100,
214,
113
]
],
"category": [
8,
7
]
} | |
332 | 500 | {
"bbox": [
[
210,
233,
107,
133
]
],
"category": [
2
]
} | |
500 | 333 | {
"bbox": [
[
14,
0,
445,
312
],
[
438,
169,
49,
61
]
],
"category": [
6,
8
]
} | |
375 | 500 | {
"bbox": [
[
57,
106,
234,
359
],
[
1,
0,
301,
500
]
],
"category": [
2,
14
]
} | |
500 | 375 | {
"bbox": [
[
404,
152,
89,
103
],
[
274,
128,
38,
42
],
[
359,
191,
22,
74
],
[
398,
180,
24,
55
],
[
269,
179,
22,
68
],
[
293,
175,
1... | |
500 | 375 | {
"bbox": [
[
351,
137,
149,
238
],
[
104,
0,
323,
245
],
[
414,
60,
51,
135
]
],
"category": [
13,
13,
14
]
} | |
500 | 333 | {
"bbox": [
[
413,
231,
45,
32
],
[
290,
236,
43,
34
],
[
182,
237,
45,
36
],
[
51,
243,
48,
31
],
[
61,
95,
46,
37
],
[
183,
93,
42,
... | |
500 | 334 | {
"bbox": [
[
0,
136,
427,
197
],
[
0,
61,
479,
174
],
[
0,
26,
422,
115
],
[
43,
6,
415,
128
],
[
198,
5,
277,
93
]
],
"category": [
6,
6,
6,... | |
500 | 333 | {
"bbox": [
[
273,
10,
164,
269
],
[
183,
213,
98,
39
]
],
"category": [
3,
3
]
} | |
500 | 375 | {
"bbox": [
[
122,
114,
257,
161
],
[
74,
0,
354,
375
]
],
"category": [
11,
8
]
} | |
496 | 500 | {
"bbox": [
[
0,
22,
451,
478
]
],
"category": [
2
]
} | |
500 | 335 | {
"bbox": [
[
1,
103,
397,
231
]
],
"category": [
11
]
} | |
500 | 375 | {
"bbox": [
[
208,
186,
20,
44
],
[
241,
181,
33,
78
],
[
268,
187,
27,
72
]
],
"category": [
14,
14,
14
]
} | |
333 | 500 | {
"bbox": [
[
39,
70,
294,
403
],
[
32,
41,
299,
95
]
],
"category": [
13,
13
]
} | |
375 | 500 | {
"bbox": [
[
120,
142,
255,
318
],
[
1,
153,
63,
306
],
[
269,
154,
106,
177
],
[
21,
142,
125,
358
]
],
"category": [
15,
15,
3,
14
]
} | |
500 | 333 | {
"bbox": [
[
239,
0,
261,
333
],
[
1,
0,
305,
333
]
],
"category": [
7,
7
]
} | |
500 | 419 | {
"bbox": [
[
14,
74,
461,
338
],
[
93,
40,
344,
198
]
],
"category": [
11,
11
]
} | |
500 | 333 | {
"bbox": [
[
234,
157,
228,
125
],
[
7,
165,
213,
157
],
[
197,
155,
144,
76
],
[
348,
144,
103,
122
],
[
60,
161,
110,
172
],
[
28,
165,
... | |
500 | 333 | {
"bbox": [
[
108,
32,
339,
277
],
[
379,
1,
56,
134
],
[
137,
13,
56,
102
],
[
0,
19,
75,
185
],
[
59,
47,
55,
109
],
[
31,
50,
52,
... | |
500 | 374 | {
"bbox": [
[
19,
6,
164,
349
],
[
97,
214,
332,
160
],
[
331,
139,
124,
227
],
[
21,
50,
296,
241
]
],
"category": [
14,
14,
14,
8
]
} | |
500 | 375 | {
"bbox": [
[
124,
240,
71,
44
],
[
80,
247,
25,
21
],
[
90,
249,
36,
25
]
],
"category": [
6,
6,
6
]
} | |
500 | 339 | {
"bbox": [
[
174,
124,
170,
130
],
[
52,
2,
448,
336
]
],
"category": [
11,
8
]
} | |
500 | 323 | {
"bbox": [
[
19,
51,
420,
234
],
[
0,
124,
114,
110
]
],
"category": [
18,
18
]
} | |
500 | 375 | {
"bbox": [
[
3,
76,
317,
176
]
],
"category": [
7
]
} | |
500 | 333 | {
"bbox": [
[
184,
57,
164,
129
],
[
39,
63,
361,
270
]
],
"category": [
8,
14
]
} | |
500 | 375 | {
"bbox": [
[
415,
174,
85,
140
],
[
120,
133,
232,
141
]
],
"category": [
17,
17
]
} | |
500 | 333 | {
"bbox": [
[
402,
109,
98,
156
],
[
290,
74,
152,
259
],
[
1,
6,
282,
327
]
],
"category": [
19,
14,
14
]
} | |
500 | 375 | {
"bbox": [
[
470,
173,
30,
54
],
[
295,
148,
39,
30
],
[
241,
145,
18,
24
]
],
"category": [
16,
9,
16
]
} | |
500 | 254 | {
"bbox": [
[
16,
11,
466,
224
]
],
"category": [
2
]
} | |
500 | 375 | {
"bbox": [
[
78,
232,
32,
82
],
[
53,
230,
33,
114
],
[
30,
232,
20,
71
]
],
"category": [
14,
14,
14
]
} | |
333 | 500 | {
"bbox": [
[
69,
173,
208,
155
],
[
286,
161,
30,
37
]
],
"category": [
11,
8
]
} | |
500 | 332 | {
"bbox": [
[
276,
100,
78,
160
]
],
"category": [
14
]
} | |
500 | 333 | {
"bbox": [
[
0,
41,
498,
243
]
],
"category": [
0
]
} | |
500 | 375 | {
"bbox": [
[
163,
96,
118,
279
]
],
"category": [
7
]
} | |
500 | 400 | {
"bbox": [
[
65,
120,
375,
156
]
],
"category": [
11
]
} | |
500 | 375 | {
"bbox": [
[
250,
27,
225,
240
],
[
21,
27,
230,
246
]
],
"category": [
19,
19
]
} | |
475 | 480 | {
"bbox": [
[
35,
19,
395,
455
]
],
"category": [
7
]
} | |
500 | 375 | {
"bbox": [
[
0,
25,
358,
315
]
],
"category": [
18
]
} | |
500 | 375 | {
"bbox": [
[
424,
217,
76,
58
],
[
435,
187,
32,
36
],
[
381,
208,
34,
64
],
[
352,
212,
31,
64
]
],
"category": [
1,
14,
14,
14
]
} | |
334 | 500 | {
"bbox": [
[
69,
201,
186,
299
],
[
250,
241,
84,
259
],
[
0,
143,
67,
293
],
[
0,
0,
66,
363
],
[
73,
0,
199,
462
],
[
251,
18,
83,
... | |
500 | 375 | {
"bbox": [
[
3,
0,
497,
249
]
],
"category": [
3
]
} | |
500 | 333 | {
"bbox": [
[
0,
98,
475,
168
],
[
123,
124,
49,
29
],
[
183,
120,
43,
34
]
],
"category": [
6,
14,
14
]
} | |
500 | 421 | {
"bbox": [
[
42,
65,
237,
298
]
],
"category": [
5
]
} | |
447 | 500 | {
"bbox": [
[
72,
17,
334,
483
],
[
134,
226,
204,
274
],
[
21,
0,
54,
101
],
[
41,
57,
96,
47
]
],
"category": [
14,
12,
14,
12
]
} | |
500 | 371 | {
"bbox": [
[
0,
114,
487,
216
]
],
"category": [
6
]
} | |
500 | 332 | {
"bbox": [
[
5,
55,
149,
230
],
[
144,
57,
139,
201
],
[
223,
53,
217,
279
],
[
362,
95,
138,
237
]
],
"category": [
14,
14,
14,
14
]
} | |
500 | 401 | {
"bbox": [
[
106,
145,
280,
155
],
[
1,
112,
499,
289
]
],
"category": [
11,
17
]
} | |
500 | 423 | {
"bbox": [
[
24,
52,
394,
347
]
],
"category": [
2
]
} | |
500 | 375 | {
"bbox": [
[
25,
80,
440,
186
]
],
"category": [
6
]
} | |
500 | 333 | {
"bbox": [
[
169,
45,
331,
288
]
],
"category": [
7
]
} | |
374 | 500 | {
"bbox": [
[
154,
207,
98,
201
]
],
"category": [
14
]
} | |
500 | 333 | {
"bbox": [
[
32,
104,
33,
42
],
[
76,
113,
38,
36
],
[
145,
124,
30,
26
],
[
226,
131,
21,
23
],
[
301,
126,
26,
27
],
[
372,
120,
30,
... | |
500 | 333 | {
"bbox": [
[
185,
77,
134,
187
],
[
352,
53,
27,
55
],
[
414,
50,
22,
59
],
[
475,
53,
17,
45
],
[
488,
50,
12,
50
]
],
"category": [
12,
14,
... | |
500 | 375 | {
"bbox": [
[
236,
146,
122,
45
],
[
137,
55,
29,
15
],
[
46,
113,
72,
12
],
[
2,
108,
62,
14
]
],
"category": [
6,
6,
6,
6
]
} | |
500 | 333 | {
"bbox": [
[
58,
75,
309,
191
],
[
440,
192,
18,
21
]
],
"category": [
3,
3
]
} | |
500 | 375 | {
"bbox": [
[
40,
72,
341,
280
],
[
431,
102,
65,
42
],
[
403,
113,
32,
30
]
],
"category": [
17,
6,
6
]
} | |
500 | 375 | {
"bbox": [
[
195,
82,
72,
125
]
],
"category": [
2
]
} | |
500 | 333 | {
"bbox": [
[
233,
47,
53,
77
],
[
0,
15,
498,
318
]
],
"category": [
14,
6
]
} | |
500 | 390 | {
"bbox": [
[
103,
33,
343,
357
],
[
67,
194,
54,
94
]
],
"category": [
6,
6
]
} | |
500 | 375 | {
"bbox": [
[
305,
226,
75,
73
],
[
195,
142,
114,
227
]
],
"category": [
19,
14
]
} | |
500 | 432 | {
"bbox": [
[
51,
21,
257,
307
],
[
25,
107,
431,
289
]
],
"category": [
14,
13
]
} | |
500 | 375 | {
"bbox": [
[
113,
153,
256,
195
],
[
291,
48,
155,
322
]
],
"category": [
13,
14
]
} | |
500 | 386 | {
"bbox": [
[
88,
53,
412,
333
]
],
"category": [
14
]
} | |
500 | 333 | {
"bbox": [
[
22,
27,
458,
257
],
[
101,
2,
60,
48
],
[
438,
22,
62,
156
],
[
418,
38,
26,
43
],
[
453,
35,
34,
36
],
[
11,
45,
93,
... | |
500 | 375 | {
"bbox": [
[
86,
99,
23,
66
],
[
40,
113,
33,
68
],
[
323,
147,
29,
59
],
[
425,
156,
18,
39
],
[
2,
90,
41,
116
],
[
3,
27,
458,
... | |
375 | 500 | {
"bbox": [
[
0,
289,
128,
118
],
[
93,
20,
282,
471
]
],
"category": [
11,
14
]
} | |
394 | 480 | {
"bbox": [
[
105,
63,
165,
234
],
[
108,
63,
180,
401
]
],
"category": [
14,
12
]
} | |
500 | 333 | {
"bbox": [
[
142,
4,
284,
329
]
],
"category": [
14
]
} | |
500 | 375 | {
"bbox": [
[
58,
151,
403,
224
],
[
343,
149,
157,
226
],
[
320,
84,
136,
278
],
[
303,
91,
88,
118
],
[
279,
87,
58,
85
],
[
162,
66,
... | |
500 | 375 | {
"bbox": [
[
13,
109,
483,
247
]
],
"category": [
6
]
} | |
500 | 375 | {
"bbox": [
[
288,
105,
50,
87
],
[
374,
143,
29,
45
],
[
457,
153,
23,
37
],
[
1,
0,
311,
375
]
],
"category": [
3,
3,
3,
3
]
} | |
500 | 375 | {
"bbox": [
[
0,
94,
240,
242
]
],
"category": [
19
]
} | |
500 | 375 | {
"bbox": [
[
64,
38,
395,
308
]
],
"category": [
2
]
} | |
500 | 375 | {
"bbox": [
[
425,
196,
75,
77
],
[
234,
215,
89,
43
],
[
140,
211,
29,
65
],
[
50,
209,
102,
99
],
[
0,
208,
55,
105
],
[
313,
240,
12,... | |
500 | 375 | {
"bbox": [
[
115,
63,
241,
312
],
[
1,
211,
48,
164
]
],
"category": [
14,
8
]
} | |
500 | 375 | {
"bbox": [
[
79,
3,
421,
372
],
[
0,
28,
227,
347
],
[
1,
124,
499,
251
]
],
"category": [
14,
14,
17
]
} | |
320 | 224 | {
"bbox": [
[
85,
35,
154,
189
],
[
114,
18,
89,
118
],
[
278,
76,
20,
56
]
],
"category": [
12,
14,
14
]
} | |
500 | 335 | {
"bbox": [
[
159,
133,
127,
106
]
],
"category": [
18
]
} | |
500 | 249 | {
"bbox": [
[
27,
18,
76,
149
],
[
15,
53,
163,
196
],
[
146,
22,
99,
227
],
[
226,
18,
174,
231
],
[
390,
12,
110,
237
],
[
363,
211,
2... |
FineOWOD - OWOD open-world benchmark splits in the unified detection format
Source: PASCAL VOC 2007/2012 tars (host.robots.ox.ac.uk), COCO 2017 zips (images.cocodataset.org), and the official OWOD task lists (JosephKJ/OWOD), fetched from the vendored copy in the PROB repo (github.com/orrzohar/PROB, Apache-2.0).
Converted by the finedet project into a unified, AutoTrain-compatible layout:
image / width / height / objects{bbox, category} with COCO-format
[x, y, w, h] boxes in absolute pixels. Boxes are clipped to the image and
empty boxes dropped; category ids are densified per the category tables
below.
This repository hosts one config per source release: t1, t2 (default: t1). Load one with load_dataset("finedet/owod", "<config>").
Box format
objects.bbox follows the COCO convention: [x, y, w, h] in absolute pixels,
origin at the image's top-left corner.
License
The OWOD task splits are published under Apache-2.0 (github.com/JosephKJ/OWOD). Underlying data: COCO 2017 annotations CC BY 4.0 (COCO Consortium), COCO images subject to the Flickr Terms of Use; PASCAL VOC 2007/2012 states no explicit license (images collected from Flickr).
Config t1
Example images
Boxes are colored by category: near-transparent fill, opaque outline.
![]() | ![]() |
![]() | ![]() |
Conversion notes
One config per OWOD task (t1-t4): train = that task's training image list, test = the common all-task test list (duplicate list lines collapsed). The 80-class vocabulary is task-ordered (ids 0-19 = t1/VOC ... 60-79 = t4) and identical across configs; per config, boxes are restricted to the classes known at that task. Task 1: boxes limited to the 20 VOC classes (dense ids 0-19). Note: the strict OWOD training protocol additionally hides the classes of earlier tasks at train time — reproduce it by dropping train boxes with category id < 20*(K-1). The protocol's 'unknown' class is not materialized.
Splits
- test: 9119 images
- train: 16551 images
Categories
| id | name |
|---|---|
| 0 | aeroplane |
| 1 | bicycle |
| 2 | bird |
| 3 | boat |
| 4 | bottle |
| 5 | bus |
| 6 | car |
| 7 | cat |
| 8 | chair |
| 9 | cow |
| 10 | diningtable |
| 11 | dog |
| 12 | horse |
| 13 | motorbike |
| 14 | person |
| 15 | pottedplant |
| 16 | sheep |
| 17 | sofa |
| 18 | train |
| 19 | tvmonitor |
| 20 | truck |
| 21 | traffic light |
| 22 | fire hydrant |
| 23 | stop sign |
| 24 | parking meter |
| 25 | bench |
| 26 | elephant |
| 27 | bear |
| 28 | zebra |
| 29 | giraffe |
| 30 | backpack |
| 31 | umbrella |
| 32 | handbag |
| 33 | tie |
| 34 | suitcase |
| 35 | microwave |
| 36 | oven |
| 37 | toaster |
| 38 | sink |
| 39 | refrigerator |
| 40 | frisbee |
| 41 | skis |
| 42 | snowboard |
| 43 | sports ball |
| 44 | kite |
| 45 | baseball bat |
| 46 | baseball glove |
| 47 | skateboard |
| 48 | surfboard |
| 49 | tennis racket |
| 50 | banana |
| 51 | apple |
| 52 | sandwich |
| 53 | orange |
| 54 | broccoli |
| 55 | carrot |
| 56 | hot dog |
| 57 | pizza |
| 58 | donut |
| 59 | cake |
| 60 | bed |
| 61 | toilet |
| 62 | laptop |
| 63 | mouse |
| 64 | remote |
| 65 | keyboard |
| 66 | cell phone |
| 67 | book |
| 68 | clock |
| 69 | vase |
| 70 | scissors |
| 71 | teddy bear |
| 72 | hair drier |
| 73 | toothbrush |
| 74 | wine glass |
| 75 | cup |
| 76 | fork |
| 77 | knife |
| 78 | spoon |
| 79 | bowl |
Config t2
Example images
Boxes are colored by category: near-transparent fill, opaque outline.
![]() | ![]() |
![]() | ![]() |
Conversion notes
One config per OWOD task (t1-t4): train = that task's training image list, test = the common all-task test list (duplicate list lines collapsed). The 80-class vocabulary is task-ordered (ids 0-19 = t1/VOC ... 60-79 = t4) and identical across configs; per config, boxes are restricted to the classes known at that task. Task 2: boxes limited to the 40 classes known at task 2 (ids 0-39). Note: the strict OWOD training protocol additionally hides the classes of earlier tasks at train time — reproduce it by dropping train boxes with category id < 20*(K-1). The protocol's 'unknown' class is not materialized.
Splits
- test: 9119 images
- train: 45520 images
Categories
| id | name |
|---|---|
| 0 | aeroplane |
| 1 | bicycle |
| 2 | bird |
| 3 | boat |
| 4 | bottle |
| 5 | bus |
| 6 | car |
| 7 | cat |
| 8 | chair |
| 9 | cow |
| 10 | diningtable |
| 11 | dog |
| 12 | horse |
| 13 | motorbike |
| 14 | person |
| 15 | pottedplant |
| 16 | sheep |
| 17 | sofa |
| 18 | train |
| 19 | tvmonitor |
| 20 | truck |
| 21 | traffic light |
| 22 | fire hydrant |
| 23 | stop sign |
| 24 | parking meter |
| 25 | bench |
| 26 | elephant |
| 27 | bear |
| 28 | zebra |
| 29 | giraffe |
| 30 | backpack |
| 31 | umbrella |
| 32 | handbag |
| 33 | tie |
| 34 | suitcase |
| 35 | microwave |
| 36 | oven |
| 37 | toaster |
| 38 | sink |
| 39 | refrigerator |
| 40 | frisbee |
| 41 | skis |
| 42 | snowboard |
| 43 | sports ball |
| 44 | kite |
| 45 | baseball bat |
| 46 | baseball glove |
| 47 | skateboard |
| 48 | surfboard |
| 49 | tennis racket |
| 50 | banana |
| 51 | apple |
| 52 | sandwich |
| 53 | orange |
| 54 | broccoli |
| 55 | carrot |
| 56 | hot dog |
| 57 | pizza |
| 58 | donut |
| 59 | cake |
| 60 | bed |
| 61 | toilet |
| 62 | laptop |
| 63 | mouse |
| 64 | remote |
| 65 | keyboard |
| 66 | cell phone |
| 67 | book |
| 68 | clock |
| 69 | vase |
| 70 | scissors |
| 71 | teddy bear |
| 72 | hair drier |
| 73 | toothbrush |
| 74 | wine glass |
| 75 | cup |
| 76 | fork |
| 77 | knife |
| 78 | spoon |
| 79 | bowl |
Training with transformers
The boxes are already in the absolute-pixel COCO [x, y, w, h] format that
AutoImageProcessor expects, so fine-tuning a detector needs no bbox
conversion:
import torch
from datasets import load_dataset
from transformers import (AutoImageProcessor, AutoModelForObjectDetection,
Trainer, TrainingArguments)
ds = load_dataset("finedet/owod", "t1")
obj_feat = ds["train"].features["objects"]
if hasattr(obj_feat, "feature"):
obj_feat = obj_feat.feature
cat_feat = obj_feat["category"]
names = (cat_feat.feature if hasattr(cat_feat, "feature") else cat_feat).names
checkpoint = "facebook/detr-resnet-50"
processor = AutoImageProcessor.from_pretrained(checkpoint)
model = AutoModelForObjectDetection.from_pretrained(
checkpoint,
id2label=dict(enumerate(names)),
label2id={n: i for i, n in enumerate(names)},
ignore_mismatched_sizes=True,
)
def transform(batch):
images = [img.convert("RGB") for img in batch["image"]]
annotations = [
{"image_id": i,
"annotations": [
{"bbox": box, "category_id": cat, "area": box[2] * box[3], "iscrowd": 0}
for box, cat in zip(objs["bbox"], objs["category"])
]}
for i, objs in enumerate(batch["objects"])
]
return processor(images=images, annotations=annotations, return_tensors="pt")
def collate(batch):
return {"pixel_values": torch.stack([x["pixel_values"] for x in batch]),
"labels": [x["labels"] for x in batch]}
trainer = Trainer(
model=model,
args=TrainingArguments(output_dir="out", per_device_train_batch_size=4,
num_train_epochs=10, learning_rate=1e-5,
remove_unused_columns=False),
train_dataset=ds["train"].with_transform(transform),
data_collator=collate,
)
trainer.train()
- Downloads last month
- 73







