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

convert the sound detection event predicting image into csv (Pandas format) #7

Open
SR-fr opened this issue Feb 25, 2021 · 0 comments

Comments

@SR-fr
Copy link

SR-fr commented Feb 25, 2021

`def plot_sound_event_detection_result(framewise_output):
#Visualization of sound event detection result.

#Args:framewise_output: (time_steps, classes_num)

out_fig_path = 'results/sed_result.png'
os.makedirs(os.path.dirname(out_fig_path), exist_ok=True)

classwise_output = np.max(framewise_output, axis=0) # (classes_num,)

idxes = np.argsort(classwise_output)[::-1]
idxes = idxes[0:5]

ix_to_lb = {i : label for i, label in enumerate(labels)}
lines = []
for idx in idxes:
line, = plt.plot(framewise_output[:, idx], label=ix_to_lb[idx])
lines.append(line)

plt.legend(handles=lines)
plt.xlabel('Frames')
plt.ylabel('Probability')
plt.ylim(0, 1.)
plt.savefig(out_fig_path)
print('Save fig to {}'.format(out_fig_path))
`

convert this into pandas format (timestamp,class_Name) on which particular time which kind of classes are predicting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant