more
This commit is contained in:
48
bin/wsl/find_similar_videos.sh
Executable file
48
bin/wsl/find_similar_videos.sh
Executable file
@@ -0,0 +1,48 @@
|
||||
# Use the current working directory as the image directory
|
||||
IMAGE_DIR="."
|
||||
|
||||
# Get a list of all files in the directory
|
||||
files=("$IMAGE_DIR"/*.jpg)
|
||||
|
||||
# Calculate the total number of attempts
|
||||
num_files=${#files[@]}
|
||||
total_attempts=$((num_files * (num_files - 1) / 2))
|
||||
|
||||
# Calculate hours and minutes
|
||||
total_hours=$((total_attempts / 3600))
|
||||
total_minutes=$(( (total_attempts % 3600) / 60 ))
|
||||
|
||||
# Output the number of attempts and estimated time in hours and minutes
|
||||
echo "Total attempts to compare all files: $total_attempts"
|
||||
echo "Estimated time to complete (assuming 1 second per comparison): ${total_hours} hours and ${total_minutes} minutes"
|
||||
|
||||
echo
|
||||
echo
|
||||
|
||||
# Get a list of all files in the directory
|
||||
files=("$IMAGE_DIR"/*.jpg)
|
||||
|
||||
# Loop through each file by index
|
||||
x=0
|
||||
for ((i=0; i<${#files[@]}-1; i++)); do
|
||||
for ((j=i+1; j<${#files[@]}; j++)); do
|
||||
x=$((x + 1))
|
||||
# Compare files[i] with files[j]
|
||||
similar_images.py "${files[i]}" "${files[j]}"
|
||||
|
||||
# Calculate number of symbols based on x % 10
|
||||
mod_result=$((x % 10))
|
||||
# Determine whether to use * or o based on x being even or odd
|
||||
if (( x % 2 == 0 )); then
|
||||
symbol="*"
|
||||
else
|
||||
symbol="o"
|
||||
fi
|
||||
# Clear the line and print the symbols on the same line
|
||||
printf "\r"
|
||||
for ((k=0; k<mod_result; k++)); do
|
||||
printf "$symbol"
|
||||
done
|
||||
|
||||
done
|
||||
done
|
||||
Reference in New Issue
Block a user