Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20240814 fix strat split #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion coco_data_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@


def plot_label_frequencies(coco, data_path, title, ax, labels_common=None):
if labels_common is not None:
if len(labels_common) > 0:
label_freqs = {l: 0 for l in labels_common}
else:
label_freqs = {l: 0 for l in CROP_ENCODING.values()}
Expand Down Expand Up @@ -162,6 +162,22 @@ def create_dataframe(data_path, tiles, years, common_labels=None):

common_lbls = common_labels(train_tiles | test_tiles)

# If common_lbls is an empty set, it is expected to equal None later
if common_lbls is not None and len(common_lbls) == 0:
common_lbls = None

# If args.tiles is 'all', then train_tiles and test_tiles is also expected
# to be 'all'
if args.tiles == 'all':
train_tiles = 'all'
test_tiles = 'all'

# If args.years is 'all', then train_years and test_years is also expected
# to be 'all'
if args.years == 'all':
train_years = 'all'
test_years = 'all'

# Define prefix
if args.prefix is None:
# No prefix given, use current timestamp
Expand Down