This script processes animal image data and predicts their viewpoints using a pre-trained model.
Run the script from the command line with the following arguments:
python viewpoint_classifier.py <image_dir> <in_csv_path> <out_csv_path> [model_checkpoint_path] [gt_csv_path]
image_dir
: Directory containing localized images.in_csv_path
: Path to the input CSV file for the classifier.out_csv_path
: Path to save the output CSV file.model_checkpoint_path
(optional): Path to the model checkpoint file. (use default if not provided)gt_csv_path
(optional): Path to the ground truth CSV file for evaluation.
python viewpoint_classifier.py ./input_img_example ./input_example.csv ./output_example.csv
- Processed CSV file at the specified output path.
- If
gt_csv_path
is provided:- Visual evaluation metrics.
- Misclassified images saved in the
misclassified_images
directory.