Skip to content

Instantly share code, notes, and snippets.

@dpoulopoulos
Created August 24, 2021 14:13
Show Gist options
  • Save dpoulopoulos/c1dff63f374b52e1f6a4a0a02f767a1e to your computer and use it in GitHub Desktop.
Save dpoulopoulos/c1dff63f374b52e1f6a4a0a02f767a1e to your computer and use it in GitHub Desktop.
num_samples = 4096
num_tfrecods = len(annotations) // num_samples
if len(annotations) % num_samples:
num_tfrecods += 1 # add one record if there are any remaining samples
if not os.path.exists(tfrecords_dir):
os.makedirs(tfrecords_dir) # creating TFRecords output folder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment