From 449c2fcfb6edbe53cb75ffdf183d1b1404da777e Mon Sep 17 00:00:00 2001 From: dasbd72 Date: Sun, 24 Sep 2023 20:02:05 +0800 Subject: [PATCH] first download remote flag --- image-recognition/image-recognition.py | 4 ++-- image-scale/image-scale.py | 6 +++--- video-merge/video-merge.py | 4 ++-- video-split/video-split.py | 6 +++--- video-transcode/video-transcode.py | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/image-recognition/image-recognition.py b/image-recognition/image-recognition.py index 4d0fc9b..5dea646 100644 --- a/image-recognition/image-recognition.py +++ b/image-recognition/image-recognition.py @@ -26,10 +26,10 @@ model = resnet50(weights=ResNet50_Weights.DEFAULT) -def downloadImages(minio_client: Minio, bucket_name, remote_path, local_path, object_list=[]): +def downloadImages(minio_client: Minio, bucket_name, remote_path, local_path, object_list=[], remote_download=False): cnt = 0 for obj in object_list: - minio_client.fget_object(bucket_name, remote_path + obj, local_path + os.path.basename(obj)) + minio_client.fget_object(bucket_name, remote_path + obj, local_path + os.path.basename(obj), remote_download=remote_download) cnt += 1 return cnt diff --git a/image-scale/image-scale.py b/image-scale/image-scale.py index 126309b..cc81aff 100644 --- a/image-scale/image-scale.py +++ b/image-scale/image-scale.py @@ -17,10 +17,10 @@ secret_key = os.getenv("MINIO_SECRET_KEY") -def downloadImages(minio_client: Minio, bucket_name, remote_path, local_path, object_list=[]): +def downloadImages(minio_client: Minio, bucket_name, remote_path, local_path, object_list=[], remote_download=False): cnt = 0 for obj in object_list: - minio_client.fget_object(bucket_name, remote_path + obj, local_path + os.path.basename(obj)) + minio_client.fget_object(bucket_name, remote_path + obj, local_path + os.path.basename(obj), remote_download=remote_download) cnt += 1 return cnt @@ -100,7 +100,7 @@ def imageRecognition(): print(f"Connected to {endpoint}") download_start_time = time.perf_counter() - downloadImages(minio_client, bucket_name, download_path, local_path, object_list=object_list) + downloadImages(minio_client, bucket_name, download_path, local_path, object_list=object_list, remote_download=True) download_end_time = time.perf_counter() download_duration = download_end_time - download_start_time diff --git a/video-merge/video-merge.py b/video-merge/video-merge.py index 151bbf6..47b46f8 100644 --- a/video-merge/video-merge.py +++ b/video-merge/video-merge.py @@ -19,10 +19,10 @@ secret_key = os.getenv("MINIO_SECRET_KEY") -def downloadVideos(minio_client: Minio, bucket_name, remote_path, local_path, object_list=[]): +def downloadVideos(minio_client: Minio, bucket_name, remote_path, local_path, object_list=[], remote_download=False): cnt = 0 for obj in object_list: - minio_client.fget_object(bucket_name, remote_path + obj, local_path + os.path.basename(obj)) + minio_client.fget_object(bucket_name, remote_path + obj, local_path + os.path.basename(obj), remote_download=remote_download) cnt += 1 return cnt diff --git a/video-split/video-split.py b/video-split/video-split.py index 50254e3..9575554 100644 --- a/video-split/video-split.py +++ b/video-split/video-split.py @@ -19,10 +19,10 @@ secret_key = os.getenv("MINIO_SECRET_KEY") -def downloadVideos(minio_client: Minio, bucket_name, remote_path, local_path, object_list=[]): +def downloadVideos(minio_client: Minio, bucket_name, remote_path, local_path, object_list=[], remote_download=False): cnt = 0 for obj in object_list: - minio_client.fget_object(bucket_name, remote_path + obj, local_path + os.path.basename(obj)) + minio_client.fget_object(bucket_name, remote_path + obj, local_path + os.path.basename(obj), remote_download=remote_download) cnt += 1 return cnt @@ -96,7 +96,7 @@ def videoSplit(): print(f"Connected to {endpoint}") download_start_time = time.perf_counter() - downloadVideos(minio_client, bucket_name, download_path, local_path, object_list=object_list) + downloadVideos(minio_client, bucket_name, download_path, local_path, object_list=object_list, remote_download=True) download_end_time = time.perf_counter() download_duration = download_end_time - download_start_time diff --git a/video-transcode/video-transcode.py b/video-transcode/video-transcode.py index 02a5c76..62e13b8 100644 --- a/video-transcode/video-transcode.py +++ b/video-transcode/video-transcode.py @@ -19,10 +19,10 @@ secret_key = os.getenv("MINIO_SECRET_KEY") -def downloadVideos(minio_client: Minio, bucket_name, remote_path, local_path, object_list=[]): +def downloadVideos(minio_client: Minio, bucket_name, remote_path, local_path, object_list=[], remote_download=False): cnt = 0 for obj in object_list: - minio_client.fget_object(bucket_name, remote_path + obj, local_path + os.path.basename(obj)) + minio_client.fget_object(bucket_name, remote_path + obj, local_path + os.path.basename(obj), remote_download=remote_download) cnt += 1 return cnt