In the current project, we need to implement the batch processing functionality in the main.py file. The purpose of this feature is to process a batch of images located in the 'val_data' directory, perform face recognition on each image, and save the processed images to the 'predicted_val_data' directory.
Expected behavior
The batch_processing function in main.py should:
Create the 'predicted_val_data' directory if it doesn't exist. (Refer to # TODO 2)
Traverse the 'val_data' directory and process each image.
For each image:
Get the relative path from 'val_data' to the image.
Extract the directory part (excluding the file name).
Create the corresponding directory structure in 'predicted_val_data'.
Create the output path for the processed image.
Save the processed image in the corresponding directory.
Additional context
The code skeleton and comments for the batch_processing function are already in place.
You can locate the function that needs modification by searching for # TODO 2 in the main.py file.
Description
In the current project, we need to implement the batch processing functionality in the
main.py
file. The purpose of this feature is to process a batch of images located in the 'val_data' directory, perform face recognition on each image, and save the processed images to the 'predicted_val_data' directory.Expected behavior
batch_processing
function inmain.py
should:# TODO 2
)Additional context
batch_processing
function are already in place.# TODO 2
in themain.py
file.