Accomplish the exp scripts v1; Add video recording and trajectory recording of desktop agent; Fix minor bugs

This commit is contained in:
Timothyxxx
2024-01-15 13:49:48 +08:00
parent f153a4c253
commit 24169a65d0
6 changed files with 127 additions and 21 deletions

View File

@@ -86,6 +86,9 @@ def compare_images(image1_path, image2_path):
# score = compare_images('path_to_image1', 'path_to_image2')
# print("Similarity score:", score)
if not image1_path or not image2_path:
return 0
# Open the images and convert to grayscale
image1 = Image.open(image1_path).convert('L')
image2 = Image.open(image2_path).convert('L')
@@ -119,6 +122,9 @@ def compare_audios(audio_path_1, audio_path_2, max_distance=1000):
# print(f'Similarity Score: {similarity}')
# Convert to common format if necessary and load audio
if not audio_path_1 or not audio_path_2:
return 0
y1, sr1 = librosa.load(audio_path_1)
y2, sr2 = librosa.load(audio_path_2)