Spaces:
Running
Running
Update src/get_labels_from_samples.py
Browse files
src/get_labels_from_samples.py
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
from segments import SegmentsClient
|
2 |
import math
|
|
|
3 |
|
4 |
def get_samples(client, dataset_identifier):
|
5 |
dataset = client.get_dataset(dataset_identifier)
|
6 |
samples_count = getattr(dataset, "samples_count", 0)
|
7 |
-
|
8 |
page = 1
|
9 |
per_page = 1000
|
10 |
samples = []
|
11 |
-
while page <=
|
12 |
response = client.get_samples(dataset_identifier, per_page=per_page, page=page)
|
13 |
samples.extend(response)
|
14 |
page += 1
|
@@ -103,4 +103,4 @@ def main():
|
|
103 |
print(all_sensor_frames_and_annotations)
|
104 |
|
105 |
if __name__ == "__main__":
|
106 |
-
main()
|
|
|
|
|
1 |
import math
|
2 |
+
from segments import SegmentsClient
|
3 |
|
4 |
def get_samples(client, dataset_identifier):
|
5 |
dataset = client.get_dataset(dataset_identifier)
|
6 |
samples_count = getattr(dataset, "samples_count", 0)
|
7 |
+
total_pages = math.ceil(samples_count / 1000)
|
8 |
page = 1
|
9 |
per_page = 1000
|
10 |
samples = []
|
11 |
+
while page <= total_pages:
|
12 |
response = client.get_samples(dataset_identifier, per_page=per_page, page=page)
|
13 |
samples.extend(response)
|
14 |
page += 1
|
|
|
103 |
print(all_sensor_frames_and_annotations)
|
104 |
|
105 |
if __name__ == "__main__":
|
106 |
+
main()
|