Sebastian Cavada
commited on
Commit
·
34f6878
1
Parent(s):
25e0cf9
adding seuqential error
Browse files- prepare_data.py +13 -4
prepare_data.py
CHANGED
@@ -296,6 +296,17 @@ def generate_exhaustive_pairs(folder_path, output_file_pairs_exhaustive, scene_n
|
|
296 |
save_pairs_to_file(image_pairs, output_file_pairs_exhaustive, scene_name)
|
297 |
print(f"Processing completed for scene: {scene_name}")
|
298 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
299 |
def process_scene(scene_name, config, out_dir="./images"):
|
300 |
"""
|
301 |
Process a single scene including video extraction and image pair generation
|
@@ -318,15 +329,13 @@ def process_scene(scene_name, config, out_dir="./images"):
|
|
318 |
|
319 |
# Write the image list
|
320 |
print(f"Generating image list for scene: {scene_name}")
|
321 |
-
|
322 |
|
323 |
print(f"Generating exhaustive image pairs for scene: {scene_name}")
|
324 |
generate_exhaustive_pairs(new_folder_path, output_file_pairs_exhaustive, scene_name)
|
325 |
|
326 |
print(f"Generating sequential image pairs for scene: {scene_name}")
|
327 |
-
|
328 |
-
# Save pairs to file
|
329 |
-
save_pairs_to_file(images_pairs_sequential, output_file_pairs_sequential, scene)
|
330 |
|
331 |
# Get images from all cameras
|
332 |
# camera_images = get_list_images(new_folder_path)
|
|
|
296 |
save_pairs_to_file(image_pairs, output_file_pairs_exhaustive, scene_name)
|
297 |
print(f"Processing completed for scene: {scene_name}")
|
298 |
|
299 |
+
def generate_sequential_pairs(folder_path, output_file_pairs_sequential, scene_name):
|
300 |
+
# Get images from all cameras
|
301 |
+
camera_images = get_list_images(folder_path)
|
302 |
+
|
303 |
+
# Generate exhaustive list of pairs of images
|
304 |
+
print(f"Generating image pairs for scene: {scene_name}")
|
305 |
+
images_pairs_sequential = generate_multi_camera_pairs(camera_images)
|
306 |
+
|
307 |
+
# Save pairs to file
|
308 |
+
save_pairs_to_file(images_pairs_sequential, output_file_pairs_sequential, scene)
|
309 |
+
|
310 |
def process_scene(scene_name, config, out_dir="./images"):
|
311 |
"""
|
312 |
Process a single scene including video extraction and image pair generation
|
|
|
329 |
|
330 |
# Write the image list
|
331 |
print(f"Generating image list for scene: {scene_name}")
|
332 |
+
list_images_in_folder_multi(new_folder_path, scene_name, output_file_list)
|
333 |
|
334 |
print(f"Generating exhaustive image pairs for scene: {scene_name}")
|
335 |
generate_exhaustive_pairs(new_folder_path, output_file_pairs_exhaustive, scene_name)
|
336 |
|
337 |
print(f"Generating sequential image pairs for scene: {scene_name}")
|
338 |
+
generate_sequential_pairs(new_folder_path, output_file_pairs_sequential, scene_name)
|
|
|
|
|
339 |
|
340 |
# Get images from all cameras
|
341 |
# camera_images = get_list_images(new_folder_path)
|