File size: 878 Bytes
4fd87e4
 
 
 
 
04844bf
4fd87e4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from os import listdir
from datasets import Dataset, Image
import json
import huggingface_hub

huggingface_hub.login('')

all_rgb=listdir('data/rgb') 
all_rgb=['data/rgb/' + f for f in all_rgb]

all_d=listdir('data/d')
all_d=['data/d/' + f for f in all_d]

all_mask=listdir('data/mask')
all_mask=['data/mask/' + f for f in all_mask]


all_json =listdir('data/meta')
all_jsons=[]

for jsonfilename in all_json:
    with open('data/meta/'+jsonfilename) as json_file:
        data = json.load(json_file)
        all_jsons.append(data)


ds=Dataset.from_dict({'rgb' : all_rgb, 
                      'depth' : all_d, 
                      'mask' : all_mask,
                      'meta' : all_jsons}
                      ).cast_column('rgb',Image()).cast_column('depth',Image()).cast_column('mask',Image())

ds.push_to_hub('correll/semanticsegmentationandposeestimationfromrgbd')