Skip to content

Conversation

@elenamarreroo
Copy link

This PR addresses issue #185.

Google Colab uses a non-interactive backend (FigureCanvasAgg) that does not
support the method fig.canvas.set_window_title(), causing the mAP script
to crash during AP visualization.

This fix wraps the window-title call in a try/except block and falls back to
plt.title(), which is fully compatible with Colab and other notebook
environments.

The behavior on desktop environments remains unchanged, so the fix is fully
backward compatible.

Fixes #185

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

Successfully merging this pull request may close these issues.

Bug: AttributeError in Colab when using fig.canvas.set_window_title in mAP/main.py

1 participant