contentannotation/video2annotation.py [386:408]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def process_chunk(videos_to_process, size_chunk, worker_number):
    # Calculate start and end indices for this worker's chunk
    start_index = worker_number * size_chunk
    end_index = min(start_index + size_chunk, len(videos_to_process))

    # Process videos in this worker's chunk
    for video_id in videos_to_process[start_index:end_index]:
        process_single_video(video_id, worker_number)

if __name__ == "__main__":
    # Parse command-line arguments
    parser = argparse.ArgumentParser(description='Process videos in chunks.')
    parser.add_argument('size_chunk', type=int, help='Size of each chunk to process')
    parser.add_argument('worker_number', type=int, help='Worker number (zero-indexed)')
    parser.add_argument('--video_list', type=str, help='Optional video list file in JSON format')
    args = parser.parse_args()

    # Load the list of videos
    if args.video_list:
        with open(args.video_list, 'r') as f:
            videos_to_process = json.load(f)
        print(f"Using provided video list: {args.video_list}")
    else:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



finealignment/video_alignment.py [400:422]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def process_chunk(videos_to_process, size_chunk, worker_number):
    # Calculate start and end indices for this worker's chunk
    start_index = worker_number * size_chunk
    end_index = min(start_index + size_chunk, len(videos_to_process))

    # Process videos in this worker's chunk
    for video_id in videos_to_process[start_index:end_index]:
        process_single_video(video_id, worker_number)

if __name__ == "__main__":
    # Parse command-line arguments
    parser = argparse.ArgumentParser(description='Process videos in chunks.')
    parser.add_argument('size_chunk', type=int, help='Size of each chunk to process')
    parser.add_argument('worker_number', type=int, help='Worker number (zero-indexed)')
    parser.add_argument('--video_list', type=str, help='Optional video list file in JSON format')
    args = parser.parse_args()

    # Load the list of videos
    if args.video_list:
        with open(args.video_list, 'r') as f:
            videos_to_process = json.load(f)
        print(f"Using provided video list: {args.video_list}")
    else:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



