Skip to content

Enhance GUI with Updated Design and Add Hazmat Data JSON for Detailed Detection#1

Open
SwayamBadhe wants to merge 2 commits intomrl-amrl:masterfrom
SwayamBadhe:master
Open

Enhance GUI with Updated Design and Add Hazmat Data JSON for Detailed Detection#1
SwayamBadhe wants to merge 2 commits intomrl-amrl:masterfrom
SwayamBadhe:master

Conversation

@SwayamBadhe
Copy link

Description

This pull request introduces significant improvements to the HAZMAT detection application by enhancing the user interface and adding a comprehensive data file for detected materials. The changes aim to improve usability, provide detailed information on detected hazmat stickers, and ensure compatibility with both image and video inputs.

Changes Made

  1. Modernized GUI in main.py:

    • Redesigned the main window with a dark-themed sidebar and styled buttons for a professional, modern look.
    • Updated the detection details window to be resizable and scrollable, ensuring all information (e.g., long descriptions) is fully visible.
    • Fixed a video detection bug where the details window was cleared on every frame, ensuring persistent display of details for the first detected object per session.
    • Maintained original functionality for image and video processing while improving user experience.
  2. Added hazmat_data.json:

    • Created a new file in data/ containing detailed information for 28 hazmat materials and sticker categories.
    • Includes original 20 substances (e.g., "oxygen," "hydrogen") plus 8 common sticker labels (e.g., "flammable," "oxidizer," "explosive") detected by the model.
    • Fields include description, explosiveness, intensity, reaction to elements, storage, and waste disposal, enhancing the application’s utility for safety and compliance.

How to Test

  1. Ensure dependencies (opencv-python, pillow, imutils, numpy) are installed.
  2. Place hazmat_data.json in D:\Projects\HAZMAT-main\data\ (or adjust path in main.py if needed).
  3. Run main.py:
    • Select an image or video with hazmat stickers (e.g., "oxygen," "flammable").
    • Click "Run Detection" to verify the updated GUI and details display.
  4. For videos, confirm the details window persists across frames after the first detection.

Additional Notes

  • The JSON keys match the model’s expected labels.names output (lowercase with underscores, e.g., "non-flammable-gas"). Verify compatibility with your net/labels.names file.
  • The GUI changes are purely additive and should not affect core detection logic (DeepHAZMAT).

Motivation

These enhancements make the application more user-friendly and informative, aligning with real-world hazmat handling needs. The resizable details window and JSON data provide a foundation for future expansions (e.g., more sticker types or database integration).

Looking forward to feedback! Let me know if any adjustments are needed to integrate these changes smoothly.

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.

1 participant