Args -scores and -forreal

main
Robert 7 months ago
parent 9e0b36d600
commit 68c84d7dbc
  1. 16
      dedup.py
  2. 4
      do_dups.inc
  3. 13
      get_dups.sh

@ -163,18 +163,18 @@ def main():
# Calculate scores
matrix_score = delibs.matrix_similarity_score(matrix)
if len(sys.argv) > 3:
is_score = sys.argv[3]
else:
is_score = ""
if matrix_score == 1.0 and is_score != "scores":
if "-scores" in sys.argv:
is_score = True
else:
is_score = False
if matrix_score == 1.0 and is_score == False:
print("❌ Perfect match score, images should be identical - Duplicate Found!")
delibs.exit_timer(1)
if matrix_score < 0.3 and is_score != "scores":
if matrix_score < 0.3 and is_score != False:
print("👌Not a Duplicate, best guess!")
delibs.exit_timer(0)
if is_score == "scores":
if is_score == True:
score = delibs.find_duplicate_with_rotation(large_img1, aligned)
print(f"Score: {score}")

@ -61,7 +61,7 @@ for ((i = 0; i < ${#images[@]}; i++)); do
case $exit_code in
1) # Duplicate found
echo "$path/$outer_image # $inner_image" >> dups.txt
if [ "$2" = "forreal" ]; then
if [ $do_for_real = true ]; then
mv "$path/$outer_image" "$path/dups"
fi
break
@ -90,7 +90,7 @@ for ((i = 0; i < ${#images[@]}; i++)); do
;;
8) # Invalid outer image
echo "$path/$outer_image" >> invalid.txt
if [ "$2" = "forreal" ]; then
if [ $do_for_real = true ]; then
echo "To remove bad image run: rm $path/$outer_image"
fi
break

@ -14,7 +14,16 @@ if [ ! -d "$path" ]; then
exit 1
fi
if [ "$2" = "forreal" ]; then
do_for_real=false
for arg in "$@"; do
if [ "$arg" == "-forreal" ]; then
echo "Found -forreal flag"
do_for_real=true
break
fi
done
if [ $do_for_real = true ]; then
mkdir -p "$path/dups"
fi
@ -40,7 +49,7 @@ seconds=$((elapsed % 60))
printf "Total time to dedup everything: %02d:%02d:%02d\n" $hours $minutes $seconds
if [ "$2" != "forreal" ] && [ -f "dups.txt" ]; then
if [ $do_for_real = true ] && [ -f "dups.txt" ]; then
echo "Here are your duplicate files:"
more dups.txt
else

Loading…
Cancel
Save