Skip to content

Commit 50cb94f

Browse files
committed
fix: randomize after spatial sampling
1 parent e91373d commit 50cb94f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

mapswipe_workers/mapswipe_workers/utils/process_mapillary.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ def filter_results(
189189
organization_id: str = None,
190190
start_time: str = None,
191191
end_time: str = None,
192-
randomize_order: bool = None,
193192
):
194193
df = results_df.copy()
195194
if creator_id is not None:
@@ -222,9 +221,6 @@ def filter_results(
222221
return None
223222
df = filter_by_timerange(df, start_time, end_time)
224223

225-
if randomize_order is True:
226-
df.sample(frac=1).reset_index(drop=True)
227-
228224
return df
229225

230226

@@ -257,7 +253,6 @@ def get_image_metadata(
257253
organization_id,
258254
start_time,
259255
end_time,
260-
randomize_order,
261256
)
262257

263258
if (
@@ -270,6 +265,9 @@ def get_image_metadata(
270265
if sampling_threshold is not None:
271266
downloaded_metadata = spatial_sampling(downloaded_metadata, sampling_threshold)
272267

268+
if randomize_order is True:
269+
downloaded_metadata.sample(frac=1).reset_index(drop=True)
270+
273271
total_images = len(downloaded_metadata)
274272
if total_images > 100000:
275273
raise ValueError(

0 commit comments

Comments
 (0)