File size: 1,673 Bytes
e5ab635
 
 
 
 
 
 
 
 
 
 
 
b5dbf16
e5ab635
 
e4e90a2
 
 
e5ab635
e4e90a2
 
e5ab635
 
 
 
 
 
 
 
 
e4e90a2
 
 
 
 
b5dbf16
e5ab635
 
 
 
 
 
e4e90a2
 
 
e5ab635
 
 
e4e90a2
e5ab635
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
import vimeo
import pandas as pd
from dotenv import load_dotenv
import os
load_dotenv()

v = vimeo.VimeoClient(
    token=os.environ.get("VIMEO_TOKEN"),
    key=os.environ.get("VIMEO_KEY"),
    secret=os.environ.get("VIMEO_SECRET")
)

user_id = 'pedroooombr'  # Replace with the actual user ID
endpoint = f'/users/{user_id}/videos'
# Make the GET request
response1 = v.get(f'{endpoint}?per_page=100').json()
# response2 = v.get(f'{endpoint}?per_page=100&page=2').json()
# response3 = v.get(f'{endpoint}?per_page=100&page=3').json()
response = response1
# response['data'].extend(response2['data'])
# response['data'].extend(response3['data'])

gem_videos = [
    ("_".join(v['name'].split("_")[1:]), v['uri'].split("/")[-1]) for v in response['data'] if v['name'].startswith('GEM')
]

vista_videos = [
    ("_".join(v['name'].split("_")[1:]), v['uri'].split("/")[-1]) for v in response['data'] if v['name'].startswith('Vista')
]

rgb_videos = [
    ("_".join(v['name'].split("_")[1:]), v['uri'].split("/")[-1]) for v in response['data'] if v['name'].startswith('rgb_')
]

print(len(gem_videos), len(vista_videos), len(rgb_videos))
assert len(gem_videos) == len(vista_videos)

# Match files by title and create a csv
data = []

for vista_file in vista_videos:
    for gem_file in gem_videos:
        for rgb_file in rgb_videos:
            if vista_file[0] == gem_file[0] and vista_file[0] == "depth_" + rgb_file[0]:
                data.append((vista_file[0], vista_file[1], gem_file[1], rgb_file[1]))

# sort by file_name
data.sort(key=lambda x: x[0])
df = pd.DataFrame(data, columns=['file_name', 'vista_id', 'gem_id', 'rgb_id'])
df.to_csv('file_pairs.csv', index=False)