Skip to content

Commit

Permalink
pass random sample size
Browse files Browse the repository at this point in the history
  • Loading branch information
KatrionaGoldmann committed Nov 11, 2024
1 parent 4705852 commit a2d1200
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
1 change: 1 addition & 0 deletions s3_download_with_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def download_and_inference(
order_data_thresholds=order_data_thresholds,
csv_file=csv_file,
rerun_existing=rerun_existing
random_sample_size=random_sample_size
)
print("\N{White Heavy Check Mark}\033[0m\033[0m")

Expand Down
15 changes: 2 additions & 13 deletions utils/aws_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def get_objects(
order_data_thresholds=None,
csv_file="results.csv",
rerun_existing=False,
random_sample_size=None,
random_sample_size=10,
):
"""
Fetch objects from the S3 bucket and download them synchronously in batches.
Expand All @@ -228,21 +228,10 @@ def get_objects(
total=total_files, desc="Download files from server synchronously"
)

# if crops_interval is not None:
# first_dt = get_datetime_from_string(os.path.basename(first_dt))
# last_dt = get_datetime_from_string(os.path.basename(last_dt))
# t = first_dt
# intervals = []
# while t < last_dt:
# intervals = intervals + [t]
# t = t + timedelta(minutes=crops_interval)
# else:
# intervals = None

all_dates = list(set([get_datetime_from_string(os.path.basename(x)) for x in all_keys]))

# get a random set of n images for each date
n = 10
n = random_sample_size
subset_dates = []
for date in all_dates:
all_given_date = [x for x in all_keys if date.strftime('%Y%m%d') in x]
Expand Down

0 comments on commit a2d1200

Please sign in to comment.