| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Inventory (stock)
• Discuss (mail) |
| Lines of code | 3114 |
| Technical Name |
stock_ai_counter |
| License | LGPL-3 |
| Website | https://intellare.com |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Inventory (stock)
• Discuss (mail) |
| Lines of code | 3114 |
| Technical Name |
stock_ai_counter |
| License | LGPL-3 |
| Website | https://intellare.com |
Stock AI Object Counter
AI-Powered Inventory Counting with Meta's Segment Anything Model
Replace manual stock counting with AI-powered image analysis. Capture or upload photos of your inventory and let AI detect, segment, and count objects automatically — then update your Odoo stock quantities in one click.
Overview
This module adds an AI-powered object counting button to the Change Product Quantity wizard and the Inventory operations view. It uses Meta's Segment Anything Model (SAM) to automatically detect and segment all objects in uploaded images, then provides an interactive interface for review, adjustment, and confirmation before updating stock quantities.
Key Features
Camera Capture & Upload
Take photos directly from your device camera or upload multiple images. Supports drag-and-drop and multi-file selection for batch processing.
AI Object Detection
Leverages Meta's SAM (Segment Anything Model) for state-of-the-art object detection and segmentation with no training required.
Interactive Review
Left-click to select template objects, right-click to reject false detections. Full undo/redo support. Histogram-based similarity matching finds all matching items.
Multi-Image Carousel
Upload multiple images with a scrolling carousel view. Counts from all confirmed images are summed into a total quantity update.
Count Sessions & Audit Trail
Every count is saved as a session with date, user, AI count, expected quantity, difference, and error percentage for full traceability.
Confidence Scoring
Automatic confidence percentage and mismatch alerts help you verify count accuracy before applying changes to inventory.
How It Works
Select Product
Open AI Smart Count and choose a product from the inventory.
Capture / Upload
Take a photo with your camera or upload images of the items.
AI Analysis
SAM automatically detects and segments all objects in the images.
Review & Adjust
Select template objects, reject false detections, verify the count.
Confirm & Update
Confirm the result to update stock quantity automatically.
Dashboard & Analytics
The AI Smart Count dashboard provides a comprehensive overview for each product:
- Last AI count result and expected quantity comparison
- Difference and error percentage tracking
- Match/Difference status badges
- Historical count sessions with full audit trail
- Last count date and user information
Installation
- Install the Python dependencies listed in
requirements.txt:pip install torch torchvision opencv-python
pip install git+https://github.com/facebookresearch/segment-anything.git
- Download a SAM model checkpoint (e.g.,
sam_vit_l_0b3195.pth) from Meta SAM GitHub and place it instatic/sam_models/model.pthor configure the path in Settings > Technical > Parameters > System Parameters. - Install the module from the Odoo Apps list.
- Navigate to Inventory > AI Smart Count to start counting.
Configuration
The following system parameters can be configured under Settings > Technical > Parameters > System Parameters:
| Parameter | Default | Description |
|---|---|---|
stock_ai_counter.sam_checkpoint_path | local path | Path to the SAM model checkpoint file |
stock_ai_counter.sam_model_type | vit_l | SAM model type: vit_b, vit_l, or vit_h |
stock_ai_counter.resize_max | 512 | Maximum image dimension for processing |
stock_ai_counter.hist_bins | 32 | Number of histogram bins for similarity matching |
stock_ai_counter.sim_threshold | 0.65 | Minimum similarity score for object matching |
stock_ai_counter.area_ratio_min | 0.5 | Minimum area ratio for matching candidates |
stock_ai_counter.area_ratio_max | 1.6 | Maximum area ratio for matching candidates |
stock_ai_counter.iou_suppress | 0.5 | IoU threshold for overlapping detection suppression |
Requirements
- Odoo 18.0 (Enterprise or Community)
- Python 3.10+
- PyTorch (CPU or CUDA GPU)
- OpenCV (
opencv-python) - Meta Segment Anything Model (
segment-anything) - SAM model checkpoint file (download separately)
- Recommended: NVIDIA GPU with CUDA for faster processing
Support
For questions, bug reports, or feature requests, contact us at info@intellare.com
Please log in to comment on this module