def cams...

main
Robert 8 months ago
parent f713215719
commit 449f521fa7
  1. 81
      dedup.py

@ -34,45 +34,59 @@ withinFeet = 10 # < 10 feet
too_small = 1024 # 1KB too_small = 1024 # 1KB
too_large = 10 * 1024 * 1024 # 10MB too_large = 10 * 1024 * 1024 # 10MB
def camera_check(camera_info1, camera_info2, diff_location = False): def not_a_dup():
make1 = camera_info1['Make'] print("👌Not a Duplicate")
model1 = camera_info1['Model'] delibs.exit_timer(0)
make2 = camera_info2['Make']
model2 = camera_info2['Model'] def is_same_location(point1, point2):
if diff_location == True: if point1 == point2:
print("Images are from different Locations") return True
if make1 == make2 and model1 == model2: elif within_feet_check == True:
print("Cameras are the same.") return coordinates.haversine_distance_feet(point1, point2)
delibs.exit_timer(6)
else:
print("Different Cameras detected.")
print("👌Not a Duplicate")
delibs.exit_timer(0)
else: else:
if make1 != make2 or model1 != model2: return False
print("Different Cameras detected.")
print("👌Not a Duplicate") def is_same_camera(cam1, cam2):
delibs.exit_timer(0) return cam1 == cam2
def handle_GPS(location1, location2): def handle_GPS(location1, location2):
camera_info1, latitude1, longitude1 = location1 camera_info1, latitude1, longitude1 = location1
camera_info2, latitude2, longitude2 = location2 camera_info2, latitude2, longitude2 = location2
point1 = (latitude1, longitude1) point1 = (latitude1, longitude1)
point2 = (latitude2, longitude2) point2 = (latitude2, longitude2)
camera1 = (camera_info1['Make'], camera_info1['Model'])
if point1 == point2: camera2 = (camera_info2['Make'], camera_info2['Model'])
print("Images are both from same exact Location")
camera_check(camera_info1, camera_info2) the_location = is_same_location(point1, point2)
elif within_feet_check == True: match the_location:
feet = coordinates.haversine_distance_feet(point1, point2) case True:
print(f"Images distance in feet: {feet:.2f}") print("Images are both from same exact Location")
if feet < withinFeet: if is_same_camera(camera1, camera2):
print(f"With in requirements of {withinFeet}") print("Cameras are the same.")
camera_check(camera_info1, camera_info2) delibs.exit_timer(5)
else: else:
camera_check(camera_info1, camera_info2, True) print("Different Cameras detected.")
else: not_a_dup()
camera_check(camera_info1, camera_info2, True)
case False:
print("Images are from different Locations")
if is_same_camera(camera1, camera2) == False:
print("Different Cameras detected.")
not_a_dup()
case float() if isinstance(the_location, float): # Checks if it's a float
print(f"Images distance in feet: {the_location:.2f}")
if the_location < withinFeet:
print(f"With in requirements of {withinFeet}")
if is_same_camera(camera1, camera2):
print("Cameras are the same.")
delibs.exit_timer(6)
else:
print("Different Cameras detected.")
not_a_dup()
elif is_same_camera(camera1, camera2) == False:
print("Different Cameras detected.")
not_a_dup()
def is_module_imported(module_name): def is_module_imported(module_name):
return module_name in sys.modules return module_name in sys.modules
@ -135,8 +149,7 @@ def main():
if w != w2 and w != h2 and h != h2 and h != w2: if w != w2 and w != h2 and h != h2 and h != w2:
print("Diffent Resolutions") print("Diffent Resolutions")
print("👌Not a Duplicate") not_a_dup()
delibs.exit_timer(0)
print("Done loading images...") print("Done loading images...")
with delibs.Timer("Module - Aligning with downscaling 1/4 size - Total Time"): with delibs.Timer("Module - Aligning with downscaling 1/4 size - Total Time"):

Loading…
Cancel
Save