| --- |
| license: mit |
| tags: |
| - yolov5 |
| - smoking-detection |
| - object-detection |
| - onnx |
| - pytorch |
| --- |
| |
| # SmokeGuard Models |
|
|
| YOLOv5 models untuk deteksi aktivitas merokok secara real-time. |
|
|
| ## Models |
|
|
| | Model | Format | Size | Description | |
| |-------|--------|------|-------------| |
| | `best_checkpoint.pt` | PyTorch | ~40 MB | Model training terbaik | |
| | `last_checkpoint.pt` | PyTorch | ~40 MB | Checkpoint terakhir | |
| | `best_checkpoint.onnx` | ONNX (FP32) | ~80 MB | Export ONNX untuk inference | |
| | `best_checkpoint_int8.onnx` | ONNX (INT8) | ~20 MB | Quantized untuk CPU inference | |
|
|
| ## Usage |
|
|
| ### PyTorch |
|
|
| ```python |
| import torch |
| |
| model = torch.hub.load("ultralytics/yolov5", "custom", path="best_checkpoint.pt") |
| results = model("image.jpg") |
| results.show() |
| ``` |
|
|
| ### ONNX Runtime |
|
|
| ```python |
| import onnxruntime as ort |
| import numpy as np |
| |
| session = ort.InferenceSession("best_checkpoint_int8.onnx") |
| input_name = session.get_inputs()[0].name |
| input_data = np.random.randn(1, 3, 640, 640).astype(np.float32) |
| output = session.run(None, {input_name: input_data}) |
| ``` |
|
|
| ## Quantization |
|
|
| Untuk quantization ONNX model, lihat notebook `quantisize.ipynb`. |
|
|
| ## Citation |
|
|
| ```bibtex |
| @article{IPI4527801, |
| title = "IMPLEMENTASI METODE YOLOv5 PADA SISTEM PENDETEKSI ROKOK DI AREA BEBAS ASAP ROKOK", |
| journal = "Institut Penelitian Matematika, Komputer, Keperawatan, Pendidikan dan Ekonomi (IPM2KPE)", |
| year = "2024", |
| author = "Fathoni, Aliffatul Majid; Zuliarso, Eri" |
| } |
| ``` |
|
|