Skip to content

Commit

Permalink
first download remote flag
Browse files Browse the repository at this point in the history
  • Loading branch information
dasbd72 committed Sep 24, 2023
1 parent a06c3b0 commit 449c2fc
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions image-recognition/image-recognition.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions image-scale/image-scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions video-merge/video-merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions video-split/video-split.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions video-transcode/video-transcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 449c2fc

Please sign in to comment.