Skip to content

Commit

Permalink
handled run_demo error case
Browse files Browse the repository at this point in the history
  • Loading branch information
anaisha-d committed Dec 7, 2024
1 parent c255a16 commit 53e60e5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions run_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ fi
# Assign the argument to a variable
IMAGE_FILE=$1


#Check if file exists
if [ ! -f "combined_demo/input-imgs/$IMAGE_FILE" ]; then
echo "Error: File '$IMAGE_FILE' does not exist."
exit 1
fi


#Checks if file is an image
if ! file "combined_demo/input-imgs/$IMAGE_FILE" | grep -iE 'image|bitmap'; then
echo "Error: '$image_file' is not a valid image file."
exit 1
fi

# Run the Python script with the JPEG file
python3 color_correction/PyTorch/demo_single_image.py --i "combined_demo/input-imgs/$IMAGE_FILE" -t AWB -o combined_demo/intermediate-imgs

Expand Down

0 comments on commit 53e60e5

Please sign in to comment.