Spaces:
Runtime error
Runtime error
Commit History
-
Add stdout flush to ensure real-time log output
- Import sys module for stdout control - Add sys.stdout.flush() after each print statement in STEP 4-5 - Ensures logs appear immediately instead of being buffered - Fixes issue where STEP 4-5 logs were delayed until next inference316b417 -
Add detailed logging for inference timing and top detections
- Import time module for performance monitoring - Log start time and end time with timestamps - Show elapsed time in seconds for each inference - Add TOP 5 DETECTIONS section showing class name, confidence, size, area, and bbox - Clean up filtering result logs with summary statistics - Improves debugging and performance monitoring9c7190a -
Add input validation to prevent None image errors
- Check if image is None before processing - Validate image dimensions (must be 3D array) - Return None, None gracefully if validation fails - Fixes cv2.cvtColor() assertion error when no image uploadedcfe01e5 -
Fix tiling strategy to avoid infinite loops
- Replace while loops with for loops using calculated tile counts - Add _calculate_tiles_count() to compute optimal number of tiles per dimension - Ensure minimum overlap ratio while minimizing total tile count - Fix infinite loop issue in previous implementation - Example: 1360x800 image → 2 tiles (1x2 grid) with 30% overlap instead of timeout4da1757 -
Implement tiling strategy for high-resolution object detection
- Add _create_tiles() to split image into overlapping tiles (20% overlap) - Add _select_standard_size() to choose nearest standard size (640/960/1024) - Add _resize_to_standard() for letterbox preprocessing of tiles - Add _merge_detections() to deduplicate detections from overlapping regions using NMS - Refactor detect() method to process each tile separately then merge results - Transform bounding boxes from tile space back to original image space - Ensures maximum input resolution while maintaining accuracyf489532
-
Remove zoom feature - keep interface clean and simple
- Removed all zoom sliders and zoomed image components - Removed apply_zoom functions and global image storage - Back to core functionality: upload image, adjust threshold, detect - Auto-detection on image upload and threshold change - Manual detect button and clear button still availablef98ab8d -
Simplify zoom to bare minimum - Gradio handles scroll natively
- Removed all custom CSS and HTML attempts - Simple approach: zoom slider updates image size via cv2.resize - Gradio Image component automatically shows scroll when needed - Side-by-side zoom inspector with both detected and preprocessed - Clean, minimal code - let Gradio handle the rendering6468f09 -
Simplify zoom - use Image components with native scroll
- Return to using gr.Image components for zoomed output (Gradio native) - Gradio Image components handle scrolling automatically for large images - Removed HTML base64 approach that didn't support horizontal scroll - Much simpler implementation - just cv2.resize and display - Gradio natively scrolls any image larger than container - Zoom sliders (50-300%) adjust image size, Gradio handles the resta0d96db -
Fix horizontal scroll - remove Column constraints and add white-space nowrap
- Remove Column wrappers that constrained HTML component width - Add width: 100% and white-space: nowrap to container - Wrap image in inline-block div for proper horizontal scrolling - HTML components now expand full width with proper scroll in both directions - Update UI to hint that scrolling is available625d803 -
Fix horizontal zoom stretching - allow width to scale properly
- Remove max-width constraint that was limiting horizontal scaling - Add display: inline-block to container for proper sizing - Add image-rendering: crisp-edges for sharp pixel display - Now both width and height scale proportionally without distortionb5d427e -
Replace zoom with scrollable HTML display - actual pixel-level zoom
- Original images still display at standard size - New zoom section uses HTML with base64 encoded images - Zoomed images display at actual resized dimensions (not fixed container) - Scrollable container for images larger than 600px height - Shows zoom level and actual pixel dimensions - Zoom range expanded to 50-300% for better inspection734fa17 -
Fix reset button output error - remove None from outputs list
5cc1902 -
Simplify zoom implementation using global variables
- Store original images as module-level variables after detection - Zoom functions use simple cv2.resize on stored numpy arrays - No intermediate State components - Zoom sliders only take zoom_level as input, no image input - More direct and reliable implementation86b9261 -
Fix zoom slider functionality - now updates image display directly
- Use Gradio State to store original images after detection - Zoom sliders now update main image display (not hidden components) - Queue=False for immediate zoom response (no delay) - Cleaner UI with working zoom on all browsers/OS - Reset button also resets zoom sliders to 100%d17b1c4 -
Add zoom sliders for output and preprocessed images
- Add zoom sliders (50-200%) for both detected and preprocessed images - Zoom sliders work on all browsers/OS without keyboard shortcuts - Dynamically resize images based on slider value - Clear button now resets zoom images as well - Better UX for detailed inspection of detectionsde45b47 -
Add auto-detection, interactive zoom, and class names to top 5 detections
- Auto-detect on image upload and threshold slider change - Add Clear button to reset all fields - Show class names alongside top 5 raw confidence scores - Mark output images as non-interactive for better UX - Update UI description for auto-detection feature74ac36a
-
Add confidence threshold slider and update class labels
- Add confidence_threshold slider to UI (0.01-0.9 range) - Update detect() function to accept dynamic confidence threshold - Change from 43 classes to 29 aggregated traffic sign categories - Improve NMS IOU threshold from 0.45 to 0.55 - Update config default confidence to 0.3081a35ad -
Add detailed training prompt and guidelines
ec14871 -
Lower confidence threshold to 0.001 and add detailed confidence analysis
228675b -
Add raw predictions debug info and scale factor warnings
aed8966 -
Add detailed logging for debugging detection pipeline
8dc1ce9 -
Add full logging and preprocessed image visualization
eedb862 -
Fix model loading from HuggingFace Hub and improve inference preprocessing
77916ce
-
remove test existing model
44fc75a -
test existing model
95a780a -
fix bug
dc9db39 -
fix bug
fb70692 -
fix bug
35f997a -
fix bug
9b96f24 -
fix bug
6998ed6 -
fix bug
ef364be -
add more log to debug
21e825c -
add more logic to process image
9c6bc51
-
Lower confidence threshold to 0.25 and add debug logging for traffic sign detection
Amp-Thread-ID: https://ampcode.com/threads/T-e84964c4-a177-48da-a362-022c1ebc3a1f Co-authored-by: Amp <amp@ampcode.com>7963d0f -
add more debug log
46ed9eb -
Use monkey patch to disable weights_only for ultralytics model loading
Amp-Thread-ID: https://ampcode.com/threads/T-22e83726-d77c-475f-b185-6d55f37c5979 Co-authored-by: Amp <amp@ampcode.com>afb1d42 -
Add DetectionModel to safe globals for torch loading
Amp-Thread-ID: https://ampcode.com/threads/T-22e83726-d77c-475f-b185-6d55f37c5979 Co-authored-by: Amp <amp@ampcode.com>fdf53a5 -
Add torch safe globals for model loading
Amp-Thread-ID: https://ampcode.com/threads/T-22e83726-d77c-475f-b185-6d55f37c5979 Co-authored-by: Amp <amp@ampcode.com>679cf21 -
Fix repo_id parsing for HF Hub download
Amp-Thread-ID: https://ampcode.com/threads/T-22e83726-d77c-475f-b185-6d55f37c5979 Co-authored-by: Amp <amp@ampcode.com>e1c596d -
Download model from HF Hub at runtime
Amp-Thread-ID: https://ampcode.com/threads/T-22e83726-d77c-475f-b185-6d55f37c5979 Co-authored-by: Amp <amp@ampcode.com>98a8397
-
Force reinstall numpy 1.24.3 after all packages
Amp-Thread-ID: https://ampcode.com/threads/T-22e83726-d77c-475f-b185-6d55f37c5979 Co-authored-by: Amp <amp@ampcode.com>a633bfa
-
Downgrade numpy to 1.24.3 for compatibility
Amp-Thread-ID: https://ampcode.com/threads/T-22e83726-d77c-475f-b185-6d55f37c5979 Co-authored-by: Amp <amp@ampcode.com>c401417 -
Force reinstall opencv-python-headless to override full opencv
Amp-Thread-ID: https://ampcode.com/threads/T-22e83726-d77c-475f-b185-6d55f37c5979 Co-authored-by: Amp <amp@ampcode.com>a5940e8 -
Downgrade gradio to 3.50.2 for compatibility
Amp-Thread-ID: https://ampcode.com/threads/T-22e83726-d77c-475f-b185-6d55f37c5979 Co-authored-by: Amp <amp@ampcode.com>318d064 -
Add huggingface-hub version for compatibility
Amp-Thread-ID: https://ampcode.com/threads/T-22e83726-d77c-475f-b185-6d55f37c5979 Co-authored-by: Amp <amp@ampcode.com>dcd050f -
Load model at runtime, specify full path to model file
Amp-Thread-ID: https://ampcode.com/threads/T-22e83726-d77c-475f-b185-6d55f37c5979 Co-authored-by: Amp <amp@ampcode.com>7027a21 -
Use opencv-python-headless to avoid GUI dependencies
Amp-Thread-ID: https://ampcode.com/threads/T-22e83726-d77c-475f-b185-6d55f37c5979 Co-authored-by: Amp <amp@ampcode.com>62e47fd -
Add system dependencies for OpenCV in Docker
Amp-Thread-ID: https://ampcode.com/threads/T-22e83726-d77c-475f-b185-6d55f37c5979 Co-authored-by: Amp <amp@ampcode.com>2c73a93 -
Initial commit with Traffic Sign Detector app
Amp-Thread-ID: https://ampcode.com/threads/T-22e83726-d77c-475f-b185-6d55f37c5979 Co-authored-by: Amp <amp@ampcode.com>b11642e -
initial commit
Verified signature43c8e4b