image imagewidth (px) 512 512 | image_id int64 0 29.6k | file_name stringlengths 14 14 | width int64 512 512 | height int64 512 512 | camera_height_img int64 250 377 | objects dict |
|---|---|---|---|---|---|---|
0 | 0000_00105.jpg | 512 | 512 | 260 | {
"annotation_id": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
],
"area": [
7641.288180903489,
4019.561548461013,
6489.838118110179,
3426.163321362211,
3817.04928724084,
497.0755502676978,
341.19044366595426,
422.0509543848826,
230.57880009694... | |
1 | 0000_00120.jpg | 512 | 512 | 260 | {
"annotation_id": [
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22
],
"area": [
6247.737898517197,
4018.8094975800705,
3545.318262938727,
5211.923179177591,
9033.635181880274,
1257.8502214290436,
425.9917010010209,
357.13392234193344... | |
2 | 0000_00135.jpg | 512 | 512 | 260 | {
"annotation_id": [
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33
],
"area": [
4774.530386821483,
4088.29899897915,
3901.098493694964,
2691.1388723643336,
4096.300820352377,
619.2687774032212,
309.7246348073237,
621.8558324336631,
160.3... | |
3 | 0000_00150.jpg | 512 | 512 | 260 | {
"annotation_id": [
34,
35,
36,
37,
38,
39,
40,
41,
42,
43
],
"area": [
3727.5853144439307,
3978.048339832992,
3854.4713390765346,
2172.524584866445,
9381.08268887567,
166.77480335778966,
1007.3871960399821,
863.6552316742681,
317.545963... | |
4 | 0000_00165.jpg | 512 | 512 | 260 | {
"annotation_id": [
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55
],
"area": [
4311.267044160957,
3698.4358222986025,
4666.4456342124395,
3397.7658800978256,
1592.0616329198522,
1153.1948208370973,
81.2214951417807,
345.462092669707... | |
5 | 0000_00180.jpg | 512 | 512 | 260 | {
"annotation_id": [
56,
57,
58,
59,
60,
61,
62,
63,
64,
65,
66,
67
],
"area": [
4259.6161896578315,
3860.7284024059754,
2868.6228802667433,
2070.2456650582767,
1249.8484000558162,
1725.0242286704708,
308.6416815387666,
244.6872746234... | |
6 | 0000_00195.jpg | 512 | 512 | 260 | {
"annotation_id": [
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
79
],
"area": [
3688.2981764234987,
3923.9608404756136,
2975.414105360566,
2529.9593275607554,
1348.0963271421333,
309.00266596161896,
204.7984958982381,
806.80018507502... | |
7 | 0000_00210.jpg | 512 | 512 | 260 | {
"annotation_id": [
80,
81,
82,
83,
84,
85,
86,
87,
88,
89
],
"area": [
3677.4385617026905,
4794.324366007888,
2421.9648210574246,
3647.206116288805,
956.8493768406518,
121.23060200791708,
741.3717584330315,
211.50678975624447,
692.00713... | |
8 | 0000_00225.jpg | 512 | 512 | 260 | {
"annotation_id": [
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
100,
101,
102
],
"area": [
4141.9954318784385,
3844.2434470957173,
4362.40650406504,
2035.8919808168273,
778.9442204449144,
134.91792804106902,
163.64627169306922,
170.2... | |
9 | 0000_00240.jpg | 512 | 512 | 260 | {
"annotation_id": [
103,
104,
105,
106,
107,
108,
109,
110,
111,
112
],
"area": [
3590.59172597146,
4189.284391272097,
525.5933196730341,
1909.5775148537393,
11966.633617555688,
238.24971908255668,
1324.1811091281645,
473.19041428896674,
... | |
10 | 0000_00255.jpg | 512 | 512 | 260 | {
"annotation_id": [
113,
114,
115,
116,
117,
118,
119,
120,
121,
122,
123,
124,
125
],
"area": [
3502.6318549364355,
3890.9307657846225,
555.9160111926323,
2381.0532531341573,
8235.167720566094,
257.74287791658406,
245.46940753960385... | |
11 | 0000_00270.jpg | 512 | 512 | 260 | {
"annotation_id": [
126,
127,
128,
129,
130,
131,
132,
133,
134,
135,
136
],
"area": [
4348.057373256659,
3149.288269034452,
7399.729437944786,
3834.376539537753,
907.8156594032064,
427.164900375291,
109.49860826521544,
100.4439156586687... | |
12 | 0000_00285.jpg | 512 | 512 | 260 | {
"annotation_id": [
137,
138,
139,
140,
141,
142,
143,
144,
145
],
"area": [
4013.1841569906214,
3467.195217426429,
5909.916642797864,
4170.723775530439,
219.8395135170864,
826.7144924023765,
217.67360697997225,
208.64899640866327,
339.44568... | |
13 | 0000_00300.jpg | 512 | 512 | 260 | {
"annotation_id": [
146,
147,
148,
149,
150,
151,
152,
153
],
"area": [
3533.225284773173,
2582.241904803872,
9694.236675700091,
2186.2119108995967,
604.5285801367498,
288.6070460704607,
921.8338878239731,
270.91880935069514
],
"bbox": [
[
... | |
14 | 0000_00315.jpg | 512 | 512 | 260 | {
"annotation_id": [
154,
155,
156,
157,
158,
159,
160,
161,
162,
163,
164,
165
],
"area": [
3413.37845638619,
2191.8974155595215,
15396.888095710225,
1304.4172119769978,
586.5996871350827,
215.71827468952196,
102.57974016054524,
93.8... | |
15 | 0000_00330.jpg | 512 | 512 | 260 | {
"annotation_id": [
166,
167,
168,
169,
170,
171,
172,
173,
174,
175,
176
],
"area": [
8991.069102018933,
3494.960935950823,
2240.509984503639,
480.10928239363693,
702.5659329764029,
202.1512767973208,
126.97627073831714,
782.91504909629... | |
16 | 0000_00345.jpg | 512 | 512 | 260 | {
"annotation_id": [
177,
178,
179,
180,
181,
182,
183,
184,
185,
186,
187,
188
],
"area": [
12772.471177503103,
3567.4285588384337,
2290.0550965401253,
379.51495655877966,
394.82671249476726,
240.6562819015724,
198.6316786745103,
151... | |
17 | 0000_00360.jpg | 512 | 512 | 260 | {
"annotation_id": [
189,
190,
191,
192,
193,
194,
195,
196,
197,
198,
199
],
"area": [
6895.283789043852,
3029.140620295092,
1602.7708374644722,
308.6416815387666,
415.1320862802124,
164.8796351378148,
216.25975132380051,
250.97441998810... | |
18 | 0000_00375.jpg | 512 | 512 | 260 | {
"annotation_id": [
200,
201,
202,
203,
204,
205,
206,
207,
208,
209,
210
],
"area": [
4332.354550862582,
2132.485395965071,
2149.7524841915083,
250.9744199881023,
171.31719067868187,
362.18770426186643,
360.50311028855543,
249.109333803... | |
19 | 0000_00390.jpg | 512 | 512 | 260 | {
"annotation_id": [
211,
212,
213,
214,
215,
216,
217,
218
],
"area": [
2571.7733565411536,
1620.5794023251883,
3206.4441359860753,
238.24971908255668,
173.87416367388604,
429.5714631943067,
249.1093338033651,
186.98993103752173
],
"bbox": [
... | |
20 | 0000_00405.jpg | 512 | 512 | 260 | {
"annotation_id": [
219,
220,
221,
222,
223,
224,
225,
226,
227,
228,
229
],
"area": [
2136.907455145012,
1775.0506532707602,
212.07834842576068,
2001.8992809982299,
449.2150322045226,
137.62531121246172,
173.00178465199286,
235.54233591... | |
21 | 0000_00420.jpg | 512 | 512 | 260 | {
"annotation_id": [
230,
231,
232,
233,
234,
235,
236
],
"area": [
1512.16374732853,
213.10113762384236,
1662.87474386939,
1482.0817120908337,
344.3791394011501,
457.5477559653645,
106.37007660049501
],
"bbox": [
[
277.1996816398105,
21.... | |
22 | 0000_00435.jpg | 512 | 512 | 260 | {
"annotation_id": [
237,
238,
239,
240,
241,
242,
243
],
"area": [
1657.038829033277,
1120.8566329565733,
201.5195540573292,
1012.5613061008659,
430.7446625685769,
144.39376914094345,
363.8722982351775
],
"bbox": [
[
224.32283468428173,
... | |
23 | 0000_00450.jpg | 512 | 512 | 260 | {
"annotation_id": [
244,
245,
246,
247,
248,
249,
250,
251
],
"area": [
3056.274616079494,
797.835738574188,
731.8056712274439,
306.5961031426032,
98.18776301584154,
465.91056176144417,
209.73194967722034,
124.53962588406371
],
"bbox": [
[
... | |
24 | 0000_00465.jpg | 512 | 512 | 260 | {
"annotation_id": [
252,
253,
254,
255,
256,
257,
258,
259
],
"area": [
3021.4396192742415,
600.6780796263248,
658.7965717055545,
109.73926454711702,
23.5542335911164,
480.7710871688663,
522.6753622549776,
299.3463326503184
],
"bbox": [
[
... | |
25 | 0000_00480.jpg | 512 | 512 | 260 | {
"annotation_id": [
260,
261,
262,
263,
264,
265,
266,
267
],
"area": [
2997.103252766945,
453.336271032087,
516.1174785731597,
259.42747188989506,
71.474915724767,
714.0873524724408,
666.3772445854539,
90.51684403022892
],
"bbox": [
[
... | |
26 | 0000_00495.jpg | 512 | 512 | 260 | {
"annotation_id": [
268,
269,
270,
271,
272,
273,
274,
275
],
"area": [
1642.6896982248954,
347.8686554887229,
357.13392234193344,
232.20322999977967,
69.85048582193139,
839.2887831317338,
802.4683720007932,
85.73380042743517
],
"bbox": [
[
... | |
27 | 0000_00510.jpg | 512 | 512 | 260 | {
"annotation_id": [
276,
277,
278,
279,
280,
281,
282,
283
],
"area": [
933.4455534257239,
295.10476568180314,
237.52775023685197,
84.38010884173882,
420.0956220944323,
606.4538303919625,
59.83316808777844,
212.13851249623607
],
"bbox": [
[
... | |
28 | 0000_00525.jpg | 512 | 512 | 260 | {
"annotation_id": [
284,
285,
286,
287,
288,
289,
290
],
"area": [
604.2879238548483,
258.7055030441903,
180.3117192147531,
62.90153568202349,
540.5440911861692,
593.307980993089,
73.34000190950418
],
"bbox": [
[
24.191828454156266,
234.... | |
29 | 0000_00540.jpg | 512 | 512 | 260 | {
"annotation_id": [
291,
292,
293,
294
],
"area": [
236.80578139114724,
317.6662921100756,
470.63344129376253,
514.3426384941356
],
"bbox": [
[
378.1377965749487,
34.10704410217283,
7.951833446266958,
14.541317506452618
],
[
221.328395... | |
30 | 0000_00555.jpg | 512 | 512 | 260 | {
"annotation_id": [
295,
296,
297,
298,
299
],
"area": [
196.61618231358466,
173.6335073919845,
277.50677506775065,
440.6115701265413,
443.228707192221
],
"bbox": [
[
382.10408119602516,
36.50490237597797,
7.542846226877872,
12.7773492670515... |
End of preview. Expand in Data Studio
from datasets import load_dataset
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import numpy as np
# 1. Load the dataset
# Note: Since this is a private repo, ensure you have run `huggingface-cli login`
repo_id = "bdanko/loaf_resolution_512"
print(f"Downloading {repo_id}...")
dataset = load_dataset(repo_id, split="train")
# 2. Grab the first example
example = dataset[0]
# Hugging Face automatically decodes the Parquet bytes into a PIL Image
img = example["image"]
objects = example["objects"]
# Print image-level metadata
print("\n--- Image Metadata ---")
print(f"File Name: {example['file_name']}")
print(f"Image ID: {example['image_id']}")
print(f"Dimensions: {example['width']}x{example['height']}")
print(f"Camera Height (Image): {example['camera_height_img']}")
# 3. Set up the matplotlib plot
fig, ax = plt.subplots(1, figsize=(10, 8))
ax.imshow(img)
ax.axis("off")
ax.set_title(f"Sample: {example['file_name']}", fontsize=14)
print("\n--- Object Metadata ---")
# 4. Iterate through all objects in this image
# We use zip to unpack all the parallel lists stored inside the 'objects' dictionary
num_objects = len(objects["annotation_id"])
for i in range(num_objects):
ann_id = objects["annotation_id"][i]
cat_id = objects["category_id"][i]
bbox = objects["bbox"][i]
seg = objects["segmentation"][i]
# Custom / 3D annotations
ritbox = objects["ritbox"][i]
rot_box = objects["rotated_box"][i]
world_loc = objects["world_location"][i]
person_loc = objects["person_location"][i]
cam_height_ann = objects["camera_height_ann"][i]
print(f"\nObject {i+1} (Ann ID: {ann_id} | Category: {cat_id})")
print(f" - 2D BBox: {bbox}")
print(f" - Ritbox: {ritbox}")
print(f" - Rotated Box: {rot_box}")
print(f" - World Location: {world_loc}")
print(f" - Person Location: {person_loc}")
print(f" - Camera Height: {cam_height_ann}")
# --- Plotting the 2D Bounding Box ---
# COCO bbox format is [top_left_x, top_left_y, width, height]
if len(bbox) == 4:
x, y, w, h = bbox
rect = patches.Rectangle(
(x, y), w, h,
linewidth=2, edgecolor='red', facecolor='none', label=f"Cat {cat_id}"
)
ax.add_patch(rect)
ax.text(x, y - 5, f"Cat {cat_id}", color='red', fontsize=10, weight='bold')
# --- Plotting the Segmentation Polygon ---
# COCO segmentation is a flat list: [x1, y1, x2, y2, ...]
if len(seg) > 0:
# Reshape flat list into a list of (x, y) coordinate pairs
poly_coords = np.array(seg).reshape(-1, 2)
polygon = patches.Polygon(
poly_coords,
linewidth=2, edgecolor='cyan', facecolor='cyan', alpha=0.3
)
ax.add_patch(polygon)
plt.tight_layout()
plt.show()
- Downloads last month
- 11
