Skip to content

Commit

Permalink
Update segmentation.py and config_default.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
shaupert committed Jan 16, 2023
1 parent 2188ea0 commit 24d8ae9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion bambird/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,12 @@ def multicpu_extract_rois(
"WARNING: dataset must be a valid path to a directory, a csv file"
+ "or a dataframe"
)


# Check if there is a column categories in the df
#---------------------------------------------
if ('categories' in df_data.columns) == False :
df_data['categories'] = "default"

# Check if the output directory already exists
#---------------------------------------------
Expand Down Expand Up @@ -455,7 +461,7 @@ def multicpu_extract_rois(
if verbose :
print('Composition of the dataset : ')
print(' -number of files : %2.0f' % len(df_data[~mask]))
print(' -number of categories : %2.0f' % len(df_data[~mask].categories.unique()))
print(' -number of categories : %2.0f' % len(df_data[~mask]['categories'].unique()))
print(' -unique categories : {}'.format(df_data[~mask]['categories'].unique()))

# Number of CPU used for the calculation. By default, set to all available
Expand Down
2 changes: 1 addition & 1 deletion config_default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PARAMS_EXTRACT:
MODE_RMBCKG: median # Mode to compute the remove_background {'mean', 'median'}
NFFT: 1024 # Number of points used for the SFFT to compute the spectrogram
N_RUNNING_MEAN: 10 # Number of points used to compute the running mean of the noise profil
# hysteretic thresholding parameters
# hysteretic thresholding parameters (in dB)
MASK_PARAM1: 26
MASK_PARAM2: 10
# Select and merge bbox parameters
Expand Down

0 comments on commit 24d8ae9

Please sign in to comment.