This project showcases a full Smart Office object detection and segmentation pipeline powered by YOLOv11 and Streamlit, enhanced with SAHI (Slicing Aided Hyper Inference) for detecting small and overlapping objects. It provides a clean, interactive web UI for image inference tasks.
- Object Detection using YOLOv11 (custom fine-tuned weights)
- Instance Segmentation with YOLOv11L-seg model
- SAHI slicing support for better detection of small/overlapping objects
- Upload and detect objects in images (videos and streams coming soon)
- Clean, responsive UI with Streamlit
smart-office/
├── app.py
├── helper.py
├── sahi_helper.py
├── evaluate.py
├── settings.py
├── datasets
│ └──*your dataset*
├──.streamlit
│ └── config.toml
├── weights/
│ ├── yolo11l.pt
│ ├── best.pt
│ └── yolov11l-seg.pt
├── images/
│ ├── temp - yolo11l.jpg
│ ├── temp - sahi.jpg
│ └── temp.jpg
├── requirements.txt
├── notebook
│ └── cv-project-training.ipynb
Python 3.10+ is recommended
# Clone this repository
git clone https://github.com/AzamatMedetbekov/smart-office.git
cd smart-office
# Install dependencies
pip install -r requirements.txtOr manually:
pip install streamlit opencv-python numpy matplotlib Pillow \
scikit-image tqdm PyYAML requests scipy \
sahi ultralytics torch torchvision \
cvzone filterpy lap hydra-core yt-dlpPlace your model weights in the weights/ directory:
- Detection:
weights/yolo11l.pt - Segmentation:
weights/yolov11l-seg.pt
If you don’t have weights, train using the steps below or download YOLOv11 models from Ultralytics.
streamlit run app.py- Select Task: Detection or Segmentation
- Set Confidence threshold (slider)
- Toggle SAHI for slicing inference
- Upload Image or use default sample
- Click 'Detect Objects' to see results
Only image input is supported in this version.
We used the dataset Office Object Detection Dataset from Kaggle.
Training was done using YOLOv11L model on this dataset. We used Google Colab with a NVIDIA A100 GPU for training. Refer to the provided notebook cv-project-training.ipynb for full training configuration.
Example training:
from ultralytics import YOLO
model = YOLO('/content/yolo11l.pt')
model.train(
data = '/content/data/dataset.yaml',
epochs = 20,
imgsz = 640,
batch = 16,
workers= 4,
project= 'runs/train',
name = 'office_yolov11'
)Minimal data.yaml:
train: images/train
val: images/val
nc: 6
names:
- Background
- chair
- dining table
- keyboard
- laptop
- personMake sure label files (.txt) have correct class indices.
To enhance detection of small, overlapping, or dense objects, this project uses a custom run_sahi_inference.
SAHI is used after model training to improve detection of small/overlapping objects.
| Uploaded Image | YOLOv11 Detection | YOLOv11 + SAHI Detection |
|---|---|---|
![]() |
![]() |
![]() |
See the provided file. Main packages include:
ultralytics>=8.2.0,<12.0.0sahi>=0.11.14torch,torchvisionstreamlit,opencv-python,matplotlib, etc.
- YOLOv11 by Ultralytics for object detection/segmentation
- Streamlit for front-end visualization
- SAHI for improved slicing-based inference
- Kaggle Notebooks dataset + Google Colab for model training
- Kaggle Notebooks will stop training when tab/browser closes unless GPU is persistent
- SAHI helps when objects are small, dense, or overlapping
- Segmentation model used:
yolov11l-seg.pt


