ultralytics 8.3.53__tar.gz → 8.3.54__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. {ultralytics-8.3.53/ultralytics.egg-info → ultralytics-8.3.54}/PKG-INFO +2 -2
  2. {ultralytics-8.3.53 → ultralytics-8.3.54}/README.md +1 -1
  3. {ultralytics-8.3.53 → ultralytics-8.3.54}/tests/test_solutions.py +1 -1
  4. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/__init__.py +1 -1
  5. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/__init__.py +56 -55
  6. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/engine/exporter.py +10 -10
  7. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/solutions/__init__.py +2 -2
  8. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/solutions/parking_management.py +3 -1
  9. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/solutions/security_alarm.py +2 -1
  10. ultralytics-8.3.54/ultralytics/solutions/streamlit_inference.py +191 -0
  11. {ultralytics-8.3.53 → ultralytics-8.3.54/ultralytics.egg-info}/PKG-INFO +2 -2
  12. ultralytics-8.3.53/ultralytics/solutions/streamlit_inference.py +0 -148
  13. {ultralytics-8.3.53 → ultralytics-8.3.54}/LICENSE +0 -0
  14. {ultralytics-8.3.53 → ultralytics-8.3.54}/pyproject.toml +0 -0
  15. {ultralytics-8.3.53 → ultralytics-8.3.54}/setup.cfg +0 -0
  16. {ultralytics-8.3.53 → ultralytics-8.3.54}/tests/__init__.py +0 -0
  17. {ultralytics-8.3.53 → ultralytics-8.3.54}/tests/conftest.py +0 -0
  18. {ultralytics-8.3.53 → ultralytics-8.3.54}/tests/test_cli.py +0 -0
  19. {ultralytics-8.3.53 → ultralytics-8.3.54}/tests/test_cuda.py +0 -0
  20. {ultralytics-8.3.53 → ultralytics-8.3.54}/tests/test_engine.py +0 -0
  21. {ultralytics-8.3.53 → ultralytics-8.3.54}/tests/test_exports.py +0 -0
  22. {ultralytics-8.3.53 → ultralytics-8.3.54}/tests/test_integrations.py +0 -0
  23. {ultralytics-8.3.53 → ultralytics-8.3.54}/tests/test_python.py +0 -0
  24. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/assets/bus.jpg +0 -0
  25. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/assets/zidane.jpg +0 -0
  26. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/Argoverse.yaml +0 -0
  27. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/DOTAv1.5.yaml +0 -0
  28. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/DOTAv1.yaml +0 -0
  29. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/GlobalWheat2020.yaml +0 -0
  30. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/ImageNet.yaml +0 -0
  31. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/Objects365.yaml +0 -0
  32. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/SKU-110K.yaml +0 -0
  33. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/VOC.yaml +0 -0
  34. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/VisDrone.yaml +0 -0
  35. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/african-wildlife.yaml +0 -0
  36. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/brain-tumor.yaml +0 -0
  37. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/carparts-seg.yaml +0 -0
  38. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/coco-pose.yaml +0 -0
  39. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/coco.yaml +0 -0
  40. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/coco128-seg.yaml +0 -0
  41. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/coco128.yaml +0 -0
  42. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/coco8-pose.yaml +0 -0
  43. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/coco8-seg.yaml +0 -0
  44. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/coco8.yaml +0 -0
  45. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/crack-seg.yaml +0 -0
  46. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/dog-pose.yaml +0 -0
  47. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/dota8.yaml +0 -0
  48. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/hand-keypoints.yaml +0 -0
  49. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/lvis.yaml +0 -0
  50. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/open-images-v7.yaml +0 -0
  51. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/package-seg.yaml +0 -0
  52. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/signature.yaml +0 -0
  53. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/tiger-pose.yaml +0 -0
  54. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/datasets/xView.yaml +0 -0
  55. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/default.yaml +0 -0
  56. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/11/yolo11-cls.yaml +0 -0
  57. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/11/yolo11-obb.yaml +0 -0
  58. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/11/yolo11-pose.yaml +0 -0
  59. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/11/yolo11-seg.yaml +0 -0
  60. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/11/yolo11.yaml +0 -0
  61. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/rt-detr/rtdetr-l.yaml +0 -0
  62. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/rt-detr/rtdetr-resnet101.yaml +0 -0
  63. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/rt-detr/rtdetr-resnet50.yaml +0 -0
  64. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/rt-detr/rtdetr-x.yaml +0 -0
  65. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v10/yolov10b.yaml +0 -0
  66. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v10/yolov10l.yaml +0 -0
  67. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v10/yolov10m.yaml +0 -0
  68. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v10/yolov10n.yaml +0 -0
  69. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v10/yolov10s.yaml +0 -0
  70. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v10/yolov10x.yaml +0 -0
  71. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v3/yolov3-spp.yaml +0 -0
  72. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v3/yolov3-tiny.yaml +0 -0
  73. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v3/yolov3.yaml +0 -0
  74. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v5/yolov5-p6.yaml +0 -0
  75. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v5/yolov5.yaml +0 -0
  76. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v6/yolov6.yaml +0 -0
  77. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v8/yolov8-cls-resnet101.yaml +0 -0
  78. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v8/yolov8-cls-resnet50.yaml +0 -0
  79. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v8/yolov8-cls.yaml +0 -0
  80. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v8/yolov8-ghost-p2.yaml +0 -0
  81. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v8/yolov8-ghost-p6.yaml +0 -0
  82. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v8/yolov8-ghost.yaml +0 -0
  83. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v8/yolov8-obb.yaml +0 -0
  84. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v8/yolov8-p2.yaml +0 -0
  85. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v8/yolov8-p6.yaml +0 -0
  86. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v8/yolov8-pose-p6.yaml +0 -0
  87. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v8/yolov8-pose.yaml +0 -0
  88. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v8/yolov8-rtdetr.yaml +0 -0
  89. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v8/yolov8-seg-p6.yaml +0 -0
  90. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v8/yolov8-seg.yaml +0 -0
  91. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v8/yolov8-world.yaml +0 -0
  92. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v8/yolov8-worldv2.yaml +0 -0
  93. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v8/yolov8.yaml +0 -0
  94. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v9/yolov9c-seg.yaml +0 -0
  95. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v9/yolov9c.yaml +0 -0
  96. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v9/yolov9e-seg.yaml +0 -0
  97. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v9/yolov9e.yaml +0 -0
  98. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v9/yolov9m.yaml +0 -0
  99. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v9/yolov9s.yaml +0 -0
  100. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/models/v9/yolov9t.yaml +0 -0
  101. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/solutions/default.yaml +0 -0
  102. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/trackers/botsort.yaml +0 -0
  103. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/cfg/trackers/bytetrack.yaml +0 -0
  104. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/data/__init__.py +0 -0
  105. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/data/annotator.py +0 -0
  106. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/data/augment.py +0 -0
  107. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/data/base.py +0 -0
  108. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/data/build.py +0 -0
  109. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/data/converter.py +0 -0
  110. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/data/dataset.py +0 -0
  111. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/data/loaders.py +0 -0
  112. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/data/split_dota.py +0 -0
  113. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/data/utils.py +0 -0
  114. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/engine/__init__.py +0 -0
  115. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/engine/model.py +0 -0
  116. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/engine/predictor.py +0 -0
  117. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/engine/results.py +0 -0
  118. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/engine/trainer.py +0 -0
  119. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/engine/tuner.py +0 -0
  120. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/engine/validator.py +0 -0
  121. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/hub/__init__.py +0 -0
  122. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/hub/auth.py +0 -0
  123. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/hub/google/__init__.py +0 -0
  124. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/hub/session.py +0 -0
  125. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/hub/utils.py +0 -0
  126. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/__init__.py +0 -0
  127. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/fastsam/__init__.py +0 -0
  128. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/fastsam/model.py +0 -0
  129. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/fastsam/predict.py +0 -0
  130. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/fastsam/utils.py +0 -0
  131. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/fastsam/val.py +0 -0
  132. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/nas/__init__.py +0 -0
  133. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/nas/model.py +0 -0
  134. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/nas/predict.py +0 -0
  135. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/nas/val.py +0 -0
  136. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/rtdetr/__init__.py +0 -0
  137. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/rtdetr/model.py +0 -0
  138. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/rtdetr/predict.py +0 -0
  139. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/rtdetr/train.py +0 -0
  140. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/rtdetr/val.py +0 -0
  141. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/sam/__init__.py +0 -0
  142. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/sam/amg.py +0 -0
  143. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/sam/build.py +0 -0
  144. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/sam/model.py +0 -0
  145. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/sam/modules/__init__.py +0 -0
  146. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/sam/modules/blocks.py +0 -0
  147. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/sam/modules/decoders.py +0 -0
  148. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/sam/modules/encoders.py +0 -0
  149. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/sam/modules/memory_attention.py +0 -0
  150. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/sam/modules/sam.py +0 -0
  151. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/sam/modules/tiny_encoder.py +0 -0
  152. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/sam/modules/transformer.py +0 -0
  153. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/sam/modules/utils.py +0 -0
  154. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/sam/predict.py +0 -0
  155. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/utils/__init__.py +0 -0
  156. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/utils/loss.py +0 -0
  157. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/utils/ops.py +0 -0
  158. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/__init__.py +0 -0
  159. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/classify/__init__.py +0 -0
  160. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/classify/predict.py +0 -0
  161. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/classify/train.py +0 -0
  162. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/classify/val.py +0 -0
  163. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/detect/__init__.py +0 -0
  164. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/detect/predict.py +0 -0
  165. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/detect/train.py +0 -0
  166. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/detect/val.py +0 -0
  167. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/model.py +0 -0
  168. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/obb/__init__.py +0 -0
  169. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/obb/predict.py +0 -0
  170. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/obb/train.py +0 -0
  171. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/obb/val.py +0 -0
  172. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/pose/__init__.py +0 -0
  173. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/pose/predict.py +0 -0
  174. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/pose/train.py +0 -0
  175. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/pose/val.py +0 -0
  176. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/segment/__init__.py +0 -0
  177. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/segment/predict.py +0 -0
  178. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/segment/train.py +0 -0
  179. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/segment/val.py +0 -0
  180. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/world/__init__.py +0 -0
  181. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/world/train.py +0 -0
  182. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/models/yolo/world/train_world.py +0 -0
  183. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/nn/__init__.py +0 -0
  184. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/nn/autobackend.py +0 -0
  185. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/nn/modules/__init__.py +0 -0
  186. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/nn/modules/activation.py +0 -0
  187. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/nn/modules/block.py +0 -0
  188. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/nn/modules/conv.py +0 -0
  189. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/nn/modules/head.py +0 -0
  190. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/nn/modules/transformer.py +0 -0
  191. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/nn/modules/utils.py +0 -0
  192. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/nn/tasks.py +0 -0
  193. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/solutions/ai_gym.py +0 -0
  194. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/solutions/analytics.py +0 -0
  195. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/solutions/distance_calculation.py +0 -0
  196. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/solutions/heatmap.py +0 -0
  197. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/solutions/object_counter.py +0 -0
  198. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/solutions/queue_management.py +0 -0
  199. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/solutions/region_counter.py +0 -0
  200. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/solutions/solutions.py +0 -0
  201. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/solutions/speed_estimation.py +0 -0
  202. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/solutions/trackzone.py +0 -0
  203. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/trackers/__init__.py +0 -0
  204. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/trackers/basetrack.py +0 -0
  205. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/trackers/bot_sort.py +0 -0
  206. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/trackers/byte_tracker.py +0 -0
  207. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/trackers/track.py +0 -0
  208. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/trackers/utils/__init__.py +0 -0
  209. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/trackers/utils/gmc.py +0 -0
  210. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/trackers/utils/kalman_filter.py +0 -0
  211. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/trackers/utils/matching.py +0 -0
  212. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/__init__.py +0 -0
  213. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/autobatch.py +0 -0
  214. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/benchmarks.py +0 -0
  215. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/callbacks/__init__.py +0 -0
  216. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/callbacks/base.py +0 -0
  217. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/callbacks/clearml.py +0 -0
  218. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/callbacks/comet.py +0 -0
  219. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/callbacks/dvc.py +0 -0
  220. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/callbacks/hub.py +0 -0
  221. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/callbacks/mlflow.py +0 -0
  222. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/callbacks/neptune.py +0 -0
  223. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/callbacks/raytune.py +0 -0
  224. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/callbacks/tensorboard.py +0 -0
  225. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/callbacks/wb.py +0 -0
  226. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/checks.py +0 -0
  227. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/dist.py +0 -0
  228. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/downloads.py +0 -0
  229. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/errors.py +0 -0
  230. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/files.py +0 -0
  231. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/instance.py +0 -0
  232. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/loss.py +0 -0
  233. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/metrics.py +0 -0
  234. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/ops.py +0 -0
  235. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/patches.py +0 -0
  236. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/plotting.py +0 -0
  237. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/tal.py +0 -0
  238. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/torch_utils.py +0 -0
  239. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/triton.py +0 -0
  240. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics/utils/tuner.py +0 -0
  241. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics.egg-info/SOURCES.txt +0 -0
  242. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics.egg-info/dependency_links.txt +0 -0
  243. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics.egg-info/entry_points.txt +0 -0
  244. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics.egg-info/requires.txt +0 -0
  245. {ultralytics-8.3.53 → ultralytics-8.3.54}/ultralytics.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ultralytics
3
- Version: 8.3.53
3
+ Version: 8.3.54
4
4
  Summary: Ultralytics YOLO 🚀 for SOTA object detection, multi-object tracking, instance segmentation, pose estimation and image classification.
5
5
  Author-email: Glenn Jocher <glenn.jocher@ultralytics.com>, Jing Qiu <jing.qiu@ultralytics.com>
6
6
  Maintainer-email: Ultralytics <hello@ultralytics.com>
@@ -143,7 +143,7 @@ See below for a quickstart install and usage examples, and see our [Docs](https:
143
143
  <details open>
144
144
  <summary>Install</summary>
145
145
 
146
- Pip install the ultralytics package including all [requirements](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) in a [**Python>=3.8**](https://www.python.org/) environment with [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/).
146
+ Pip install the Ultralytics package including all [requirements](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) in a [**Python>=3.8**](https://www.python.org/) environment with [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/).
147
147
 
148
148
  [![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Ultralytics Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)
149
149
 
@@ -55,7 +55,7 @@ See below for a quickstart install and usage examples, and see our [Docs](https:
55
55
  <details open>
56
56
  <summary>Install</summary>
57
57
 
58
- Pip install the ultralytics package including all [requirements](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) in a [**Python>=3.8**](https://www.python.org/) environment with [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/).
58
+ Pip install the Ultralytics package including all [requirements](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) in a [**Python>=3.8**](https://www.python.org/) environment with [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/).
59
59
 
60
60
  [![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Ultralytics Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)
61
61
 
@@ -82,4 +82,4 @@ def test_instance_segmentation():
82
82
  @pytest.mark.slow
83
83
  def test_streamlit_predict():
84
84
  """Test streamlit predict live inference solution."""
85
- solutions.inference()
85
+ solutions.Inference().inference()
@@ -1,6 +1,6 @@
1
1
  # Ultralytics YOLO 🚀, AGPL-3.0 license
2
2
 
3
- __version__ = "8.3.53"
3
+ __version__ = "8.3.54"
4
4
 
5
5
  import os
6
6
 
@@ -42,6 +42,7 @@ SOLUTION_MAP = {
42
42
  "workout": ("AIGym", "monitor"),
43
43
  "analytics": ("Analytics", "process_data"),
44
44
  "trackzone": ("TrackZone", "trackzone"),
45
+ "inference": ("Inference", "inference"),
45
46
  "help": None,
46
47
  }
47
48
 
@@ -97,7 +98,10 @@ SOLUTIONS_HELP_MSG = f"""
97
98
  yolo solutions analytics analytics_type="pie"
98
99
 
99
100
  6. Track objects within specific zones
100
- yolo solutions trackzone source="path/to/video/file.mp4" region=[(150, 150), (1130, 150), (1130, 570), (150, 570)]
101
+ yolo solutions trackzone source="path/to/video/file.mp4" region=[(150, 150), (1130, 150), (1130, 570), (150, 570)]
102
+
103
+ 7. Streamlit real-time webcam inference GUI
104
+ yolo streamlit-predict
101
105
  """
102
106
  CLI_HELP_MSG = f"""
103
107
  Arguments received: {str(['yolo'] + ARGV[1:])}. Ultralytics 'yolo' commands use the following syntax:
@@ -121,13 +125,10 @@ CLI_HELP_MSG = f"""
121
125
  4. Export a YOLO11n classification model to ONNX format at image size 224 by 128 (no TASK required)
122
126
  yolo export model=yolo11n-cls.pt format=onnx imgsz=224,128
123
127
 
124
- 5. Streamlit real-time webcam inference GUI
125
- yolo streamlit-predict
126
-
127
- 6. Ultralytics solutions usage
128
+ 5. Ultralytics solutions usage
128
129
  yolo solutions count or in {list(SOLUTION_MAP.keys())[1:-1]} source="path/to/video/file.mp4"
129
130
 
130
- 7. Run special commands:
131
+ 6. Run special commands:
131
132
  yolo help
132
133
  yolo checks
133
134
  yolo version
@@ -636,6 +637,9 @@ def handle_yolo_solutions(args: List[str]) -> None:
636
637
  Run analytics with custom configuration:
637
638
  >>> handle_yolo_solutions(["analytics", "conf=0.25", "source=path/to/video/file.mp4"])
638
639
 
640
+ Run inference with custom configuration, requires Streamlit version 1.29.0 or higher.
641
+ >>> handle_yolo_solutions(["inference", "model=yolo11n.pt"])
642
+
639
643
  Notes:
640
644
  - Default configurations are merged from DEFAULT_SOL_DICT and DEFAULT_CFG_DICT
641
645
  - Arguments can be provided in the format 'key=value' or as boolean flags
@@ -645,7 +649,9 @@ def handle_yolo_solutions(args: List[str]) -> None:
645
649
  - For 'analytics' solution, frame numbers are tracked for generating analytical graphs
646
650
  - Video processing can be interrupted by pressing 'q'
647
651
  - Processes video frames sequentially and saves output in .avi format
648
- - If no source is specified, downloads and uses a default sample video
652
+ - If no source is specified, downloads and uses a default sample video\
653
+ - The inference solution will be launched using the 'streamlit run' command.
654
+ - The Streamlit app file is located in the Ultralytics package directory.
649
655
  """
650
656
  full_args_dict = {**DEFAULT_SOL_DICT, **DEFAULT_CFG_DICT} # arguments dictionary
651
657
  overrides = {}
@@ -678,60 +684,56 @@ def handle_yolo_solutions(args: List[str]) -> None:
678
684
  if args and args[0] == "help": # Add check for return if user call `yolo solutions help`
679
685
  return
680
686
 
681
- cls, method = SOLUTION_MAP[s_n] # solution class name, method name and default source
682
-
683
- from ultralytics import solutions # import ultralytics solutions
684
-
685
- solution = getattr(solutions, cls)(IS_CLI=True, **overrides) # get solution class i.e ObjectCounter
686
- process = getattr(solution, method) # get specific function of class for processing i.e, count from ObjectCounter
687
-
688
- cap = cv2.VideoCapture(solution.CFG["source"]) # read the video file
689
-
690
- # extract width, height and fps of the video file, create save directory and initialize video writer
691
- import os # for directory creation
692
- from pathlib import Path
693
-
694
- from ultralytics.utils.files import increment_path # for output directory path update
687
+ if s_n == "inference":
688
+ checks.check_requirements("streamlit>=1.29.0")
689
+ LOGGER.info("💡 Loading Ultralytics live inference app...")
690
+ subprocess.run(
691
+ [ # Run subprocess with Streamlit custom argument
692
+ "streamlit",
693
+ "run",
694
+ str(ROOT / "solutions/streamlit_inference.py"),
695
+ "--server.headless",
696
+ "true",
697
+ overrides["model"],
698
+ ]
699
+ )
700
+ else:
701
+ cls, method = SOLUTION_MAP[s_n] # solution class name, method name and default source
695
702
 
696
- w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
697
- if s_n == "analytics": # analytical graphs follow fixed shape for output i.e w=1920, h=1080
698
- w, h = 1920, 1080
699
- save_dir = increment_path(Path("runs") / "solutions" / "exp", exist_ok=False)
700
- save_dir.mkdir(parents=True, exist_ok=True) # create the output directory
701
- vw = cv2.VideoWriter(os.path.join(save_dir, "solution.avi"), cv2.VideoWriter_fourcc(*"mp4v"), fps, (w, h))
703
+ from ultralytics import solutions # import ultralytics solutions
702
704
 
703
- try: # Process video frames
704
- f_n = 0 # frame number, required for analytical graphs
705
- while cap.isOpened():
706
- success, frame = cap.read()
707
- if not success:
708
- break
709
- frame = process(frame, f_n := f_n + 1) if s_n == "analytics" else process(frame)
710
- vw.write(frame)
711
- if cv2.waitKey(1) & 0xFF == ord("q"):
712
- break
713
- finally:
714
- cap.release()
705
+ solution = getattr(solutions, cls)(IS_CLI=True, **overrides) # get solution class i.e ObjectCounter
706
+ process = getattr(
707
+ solution, method
708
+ ) # get specific function of class for processing i.e, count from ObjectCounter
715
709
 
710
+ cap = cv2.VideoCapture(solution.CFG["source"]) # read the video file
716
711
 
717
- def handle_streamlit_inference():
718
- """
719
- Open the Ultralytics Live Inference Streamlit app for real-time object detection.
712
+ # extract width, height and fps of the video file, create save directory and initialize video writer
713
+ import os # for directory creation
714
+ from pathlib import Path
720
715
 
721
- This function initializes and runs a Streamlit application designed for performing live object detection using
722
- Ultralytics models. It checks for the required Streamlit package and launches the app.
716
+ from ultralytics.utils.files import increment_path # for output directory path update
723
717
 
724
- Examples:
725
- >>> handle_streamlit_inference()
718
+ w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
719
+ if s_n == "analytics": # analytical graphs follow fixed shape for output i.e w=1920, h=1080
720
+ w, h = 1920, 1080
721
+ save_dir = increment_path(Path("runs") / "solutions" / "exp", exist_ok=False)
722
+ save_dir.mkdir(parents=True, exist_ok=True) # create the output directory
723
+ vw = cv2.VideoWriter(os.path.join(save_dir, "solution.avi"), cv2.VideoWriter_fourcc(*"mp4v"), fps, (w, h))
726
724
 
727
- Notes:
728
- - Requires Streamlit version 1.29.0 or higher.
729
- - The app is launched using the 'streamlit run' command.
730
- - The Streamlit app file is located in the Ultralytics package directory.
731
- """
732
- checks.check_requirements("streamlit>=1.29.0")
733
- LOGGER.info("💡 Loading Ultralytics Live Inference app...")
734
- subprocess.run(["streamlit", "run", ROOT / "solutions/streamlit_inference.py", "--server.headless", "true"])
725
+ try: # Process video frames
726
+ f_n = 0 # frame number, required for analytical graphs
727
+ while cap.isOpened():
728
+ success, frame = cap.read()
729
+ if not success:
730
+ break
731
+ frame = process(frame, f_n := f_n + 1) if s_n == "analytics" else process(frame)
732
+ vw.write(frame)
733
+ if cv2.waitKey(1) & 0xFF == ord("q"):
734
+ break
735
+ finally:
736
+ cap.release()
735
737
 
736
738
 
737
739
  def parse_key_value_pair(pair: str = "key=value"):
@@ -853,7 +855,6 @@ def entrypoint(debug=""):
853
855
  "login": lambda: handle_yolo_hub(args),
854
856
  "logout": lambda: handle_yolo_hub(args),
855
857
  "copy-cfg": copy_default_cfg,
856
- "streamlit-predict": lambda: handle_streamlit_inference(),
857
858
  "solutions": lambda: handle_yolo_solutions(args[1:]),
858
859
  }
859
860
  full_args_dict = {**DEFAULT_CFG_DICT, **{k: None for k in TASKS}, **{k: None for k in MODES}, **special}
@@ -102,19 +102,19 @@ def export_formats():
102
102
  """Ultralytics YOLO export formats."""
103
103
  x = [
104
104
  ["PyTorch", "-", ".pt", True, True, []],
105
- ["TorchScript", "torchscript", ".torchscript", True, True, ["optimize", "batch"]],
106
- ["ONNX", "onnx", ".onnx", True, True, ["half", "dynamic", "simplify", "opset", "batch"]],
107
- ["OpenVINO", "openvino", "_openvino_model", True, False, ["half", "int8", "batch"]],
108
- ["TensorRT", "engine", ".engine", False, True, ["half", "dynamic", "simplify", "int8", "batch"]],
109
- ["CoreML", "coreml", ".mlpackage", True, False, ["half", "int8", "nms", "batch"]],
110
- ["TensorFlow SavedModel", "saved_model", "_saved_model", True, True, ["keras", "int8", "batch"]],
105
+ ["TorchScript", "torchscript", ".torchscript", True, True, ["batch", "optimize"]],
106
+ ["ONNX", "onnx", ".onnx", True, True, ["batch", "dynamic", "half", "opset", "simplify"]],
107
+ ["OpenVINO", "openvino", "_openvino_model", True, False, ["batch", "dynamic", "half", "int8"]],
108
+ ["TensorRT", "engine", ".engine", False, True, ["batch", "dynamic", "half", "int8", "simplify"]],
109
+ ["CoreML", "coreml", ".mlpackage", True, False, ["batch", "half", "int8", "nms"]],
110
+ ["TensorFlow SavedModel", "saved_model", "_saved_model", True, True, ["batch", "int8", "keras"]],
111
111
  ["TensorFlow GraphDef", "pb", ".pb", True, True, ["batch"]],
112
- ["TensorFlow Lite", "tflite", ".tflite", True, False, ["half", "int8", "batch"]],
112
+ ["TensorFlow Lite", "tflite", ".tflite", True, False, ["batch", "half", "int8"]],
113
113
  ["TensorFlow Edge TPU", "edgetpu", "_edgetpu.tflite", True, False, []],
114
- ["TensorFlow.js", "tfjs", "_web_model", True, False, ["half", "int8", "batch"]],
114
+ ["TensorFlow.js", "tfjs", "_web_model", True, False, ["batch", "half", "int8"]],
115
115
  ["PaddlePaddle", "paddle", "_paddle_model", True, True, ["batch"]],
116
- ["MNN", "mnn", ".mnn", True, True, ["batch", "int8", "half"]],
117
- ["NCNN", "ncnn", "_ncnn_model", True, True, ["half", "batch"]],
116
+ ["MNN", "mnn", ".mnn", True, True, ["batch", "half", "int8"]],
117
+ ["NCNN", "ncnn", "_ncnn_model", True, True, ["batch", "half"]],
118
118
  ["IMX", "imx", "_imx_model", True, True, ["int8"]],
119
119
  ]
120
120
  return dict(zip(["Format", "Argument", "Suffix", "CPU", "GPU", "Arguments"], zip(*x)))
@@ -10,7 +10,7 @@ from .queue_management import QueueManager
10
10
  from .region_counter import RegionCounter
11
11
  from .security_alarm import SecurityAlarm
12
12
  from .speed_estimation import SpeedEstimator
13
- from .streamlit_inference import inference
13
+ from .streamlit_inference import Inference
14
14
  from .trackzone import TrackZone
15
15
 
16
16
  __all__ = (
@@ -23,7 +23,7 @@ __all__ = (
23
23
  "QueueManager",
24
24
  "SpeedEstimator",
25
25
  "Analytics",
26
- "inference",
26
+ "Inference",
27
27
  "RegionCounter",
28
28
  "TrackZone",
29
29
  "SecurityAlarm",
@@ -5,7 +5,9 @@ import json
5
5
  import cv2
6
6
  import numpy as np
7
7
 
8
- from ultralytics.solutions.solutions import LOGGER, BaseSolution, check_requirements
8
+ from ultralytics.solutions.solutions import BaseSolution
9
+ from ultralytics.utils import LOGGER
10
+ from ultralytics.utils.checks import check_requirements
9
11
  from ultralytics.utils.plotting import Annotator
10
12
 
11
13
 
@@ -1,6 +1,7 @@
1
1
  # Ultralytics YOLO 🚀, AGPL-3.0 license
2
2
 
3
- from ultralytics.solutions.solutions import LOGGER, BaseSolution
3
+ from ultralytics.solutions.solutions import BaseSolution
4
+ from ultralytics.utils import LOGGER
4
5
  from ultralytics.utils.plotting import Annotator, colors
5
6
 
6
7
 
@@ -0,0 +1,191 @@
1
+ # Ultralytics YOLO 🚀, AGPL-3.0 license
2
+
3
+ import io
4
+ import time
5
+
6
+ import cv2
7
+
8
+ from ultralytics import YOLO
9
+ from ultralytics.utils import LOGGER
10
+ from ultralytics.utils.checks import check_requirements
11
+ from ultralytics.utils.downloads import GITHUB_ASSETS_STEMS
12
+
13
+
14
+ class Inference:
15
+ """
16
+ A class to perform object detection, image classification, image segmentation and pose estimation inference using
17
+ Streamlit and Ultralytics YOLO models. It provides the functionalities such as loading models, configuring settings,
18
+ uploading video files, and performing real-time inference.
19
+
20
+ Attributes:
21
+ st (module): Streamlit module for UI creation.
22
+ temp_dict (dict): Temporary dictionary to store the model path.
23
+ model_path (str): Path to the loaded model.
24
+ model (YOLO): The YOLO model instance.
25
+ source (str): Selected video source.
26
+ enable_trk (str): Enable tracking option.
27
+ conf (float): Confidence threshold.
28
+ iou (float): IoU threshold for non-max suppression.
29
+ vid_file_name (str): Name of the uploaded video file.
30
+ selected_ind (list): List of selected class indices.
31
+
32
+ Methods:
33
+ web_ui: Sets up the Streamlit web interface with custom HTML elements.
34
+ sidebar: Configures the Streamlit sidebar for model and inference settings.
35
+ source_upload: Handles video file uploads through the Streamlit interface.
36
+ configure: Configures the model and loads selected classes for inference.
37
+ inference: Performs real-time object detection inference.
38
+
39
+ Examples:
40
+ >>> inf = solutions.Inference(model="path/to/model/file.pt") # Model is not necessary argument.
41
+ >>> inf.inference()
42
+ """
43
+
44
+ def __init__(self, **kwargs):
45
+ """
46
+ Initializes the Inference class, checking Streamlit requirements and setting up the model path.
47
+
48
+ Args:
49
+ **kwargs (Dict): Additional keyword arguments for model configuration.
50
+ """
51
+ check_requirements("streamlit>=1.29.0") # scope imports for faster ultralytics package load speeds
52
+ import streamlit as st
53
+
54
+ self.st = st
55
+
56
+ self.temp_dict = {"model": None} # Temporary dict to store the model path
57
+ self.temp_dict.update(kwargs)
58
+
59
+ self.model_path = None # Store model file name with path
60
+ if self.temp_dict["model"] is not None:
61
+ self.model_path = self.temp_dict["model"]
62
+
63
+ LOGGER.info(f"Ultralytics Solutions: ✅ {self.temp_dict}")
64
+
65
+ def web_ui(self):
66
+ """Sets up the Streamlit web interface with custom HTML elements."""
67
+ menu_style_cfg = """<style>MainMenu {visibility: hidden;}</style>""" # Hide main menu style
68
+
69
+ # Main title of streamlit application
70
+ main_title_cfg = """<div><h1 style="color:#FF64DA; text-align:center; font-size:40px; margin-top:-50px;
71
+ font-family: 'Archivo', sans-serif; margin-bottom:20px;">Ultralytics YOLO Streamlit Application</h1></div>"""
72
+
73
+ # Subtitle of streamlit application
74
+ sub_title_cfg = """<div><h4 style="color:#042AFF; text-align:center; font-family: 'Archivo', sans-serif;
75
+ margin-top:-15px; margin-bottom:50px;">Experience real-time object detection on your webcam with the power
76
+ of Ultralytics YOLO! 🚀</h4></div>"""
77
+
78
+ # Set html page configuration and append custom HTML
79
+ self.st.set_page_config(page_title="Ultralytics Streamlit App", layout="wide", initial_sidebar_state="auto")
80
+ self.st.markdown(menu_style_cfg, unsafe_allow_html=True)
81
+ self.st.markdown(main_title_cfg, unsafe_allow_html=True)
82
+ self.st.markdown(sub_title_cfg, unsafe_allow_html=True)
83
+
84
+ def sidebar(self):
85
+ """Configures the Streamlit sidebar for model and inference settings."""
86
+ with self.st.sidebar: # Add Ultralytics LOGO
87
+ logo = "https://raw.githubusercontent.com/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg"
88
+ self.st.image(logo, width=250)
89
+
90
+ self.st.sidebar.title("User Configuration") # Add elements to vertical setting menu
91
+ self.source = self.st.sidebar.selectbox(
92
+ "Video",
93
+ ("webcam", "video"),
94
+ ) # Add source selection dropdown
95
+ self.enable_trk = self.st.sidebar.radio("Enable Tracking", ("Yes", "No")) # Enable object tracking
96
+ self.conf = float(self.st.sidebar.slider("Confidence Threshold", 0.0, 1.0, 0.25, 0.01)) # Slider for confidence
97
+ self.iou = float(self.st.sidebar.slider("IoU Threshold", 0.0, 1.0, 0.45, 0.01)) # Slider for NMS threshold
98
+
99
+ col1, col2 = self.st.columns(2)
100
+ self.org_frame = col1.empty()
101
+ self.ann_frame = col2.empty()
102
+ self.fps_display = self.st.sidebar.empty() # Placeholder for FPS display
103
+
104
+ def source_upload(self):
105
+ """Handles video file uploads through the Streamlit interface."""
106
+ self.vid_file_name = ""
107
+ if self.source == "video":
108
+ vid_file = self.st.sidebar.file_uploader("Upload Video File", type=["mp4", "mov", "avi", "mkv"])
109
+ if vid_file is not None:
110
+ g = io.BytesIO(vid_file.read()) # BytesIO Object
111
+ with open("ultralytics.mp4", "wb") as out: # Open temporary file as bytes
112
+ out.write(g.read()) # Read bytes into file
113
+ self.vid_file_name = "ultralytics.mp4"
114
+ elif self.source == "webcam":
115
+ self.vid_file_name = 0
116
+
117
+ def configure(self):
118
+ """Configures the model and loads selected classes for inference."""
119
+ # Add dropdown menu for model selection
120
+ available_models = [x.replace("yolo", "YOLO") for x in GITHUB_ASSETS_STEMS if x.startswith("yolo11")]
121
+ if self.model_path: # If user provided the custom model, insert model without suffix as *.pt is added later
122
+ available_models.insert(0, self.model_path.split(".pt")[0])
123
+ selected_model = self.st.sidebar.selectbox("Model", available_models)
124
+
125
+ with self.st.spinner("Model is downloading..."):
126
+ self.model = YOLO(f"{selected_model.lower()}.pt") # Load the YOLO model
127
+ class_names = list(self.model.names.values()) # Convert dictionary to list of class names
128
+ self.st.success("Model loaded successfully!")
129
+
130
+ # Multiselect box with class names and get indices of selected classes
131
+ selected_classes = self.st.sidebar.multiselect("Classes", class_names, default=class_names[:3])
132
+ self.selected_ind = [class_names.index(option) for option in selected_classes]
133
+
134
+ if not isinstance(self.selected_ind, list): # Ensure selected_options is a list
135
+ self.selected_ind = list(self.selected_ind)
136
+
137
+ def inference(self):
138
+ """Performs real-time object detection inference."""
139
+ self.web_ui() # Initialize the web interface
140
+ self.sidebar() # Create the sidebar
141
+ self.source_upload() # Upload the video source
142
+ self.configure() # Configure the app
143
+
144
+ if self.st.sidebar.button("Start"):
145
+ stop_button = self.st.button("Stop") # Button to stop the inference
146
+ cap = cv2.VideoCapture(self.vid_file_name) # Capture the video
147
+ if not cap.isOpened():
148
+ self.st.error("Could not open webcam.")
149
+ while cap.isOpened():
150
+ success, frame = cap.read()
151
+ if not success:
152
+ st.warning("Failed to read frame from webcam. Please make sure the webcam is connected properly.")
153
+ break
154
+
155
+ prev_time = time.time() # Store initial time for FPS calculation
156
+
157
+ # Store model predictions
158
+ if self.enable_trk == "Yes":
159
+ results = self.model.track(
160
+ frame, conf=self.conf, iou=self.iou, classes=self.selected_ind, persist=True
161
+ )
162
+ else:
163
+ results = self.model(frame, conf=self.conf, iou=self.iou, classes=self.selected_ind)
164
+ annotated_frame = results[0].plot() # Add annotations on frame
165
+
166
+ fps = 1 / (time.time() - prev_time) # Calculate model FPS
167
+
168
+ if stop_button:
169
+ cap.release() # Release the capture
170
+ self.st.stop() # Stop streamlit app
171
+
172
+ self.fps_display.metric("FPS", f"{fps:.2f}") # Display FPS in sidebar
173
+ self.org_frame.image(frame, channels="BGR") # Display original frame
174
+ self.ann_frame.image(annotated_frame, channels="BGR") # Display processed frame
175
+
176
+ cap.release() # Release the capture
177
+ cv2.destroyAllWindows() # Destroy window
178
+
179
+
180
+ if __name__ == "__main__":
181
+ import sys # Import the sys module for accessing command-line arguments
182
+
183
+ model = None # Initialize the model variable as None
184
+
185
+ # Check if a model name is provided as a command-line argument
186
+ args = len(sys.argv)
187
+ if args > 1:
188
+ model = args # Assign the first argument as the model name
189
+
190
+ # Create an instance of the Inference class and run inference
191
+ Inference(model=model).inference()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ultralytics
3
- Version: 8.3.53
3
+ Version: 8.3.54
4
4
  Summary: Ultralytics YOLO 🚀 for SOTA object detection, multi-object tracking, instance segmentation, pose estimation and image classification.
5
5
  Author-email: Glenn Jocher <glenn.jocher@ultralytics.com>, Jing Qiu <jing.qiu@ultralytics.com>
6
6
  Maintainer-email: Ultralytics <hello@ultralytics.com>
@@ -143,7 +143,7 @@ See below for a quickstart install and usage examples, and see our [Docs](https:
143
143
  <details open>
144
144
  <summary>Install</summary>
145
145
 
146
- Pip install the ultralytics package including all [requirements](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) in a [**Python>=3.8**](https://www.python.org/) environment with [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/).
146
+ Pip install the Ultralytics package including all [requirements](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) in a [**Python>=3.8**](https://www.python.org/) environment with [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/).
147
147
 
148
148
  [![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Ultralytics Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)
149
149
 
@@ -1,148 +0,0 @@
1
- # Ultralytics YOLO 🚀, AGPL-3.0 license
2
-
3
- import io
4
- import time
5
-
6
- import cv2
7
- import torch
8
-
9
- from ultralytics.utils.checks import check_requirements
10
- from ultralytics.utils.downloads import GITHUB_ASSETS_STEMS
11
-
12
-
13
- def inference(model=None):
14
- """Performs real-time object detection on video input using YOLO in a Streamlit web application."""
15
- check_requirements("streamlit>=1.29.0") # scope imports for faster ultralytics package load speeds
16
- import streamlit as st
17
-
18
- from ultralytics import YOLO
19
-
20
- # Hide main menu style
21
- menu_style_cfg = """<style>MainMenu {visibility: hidden;}</style>"""
22
-
23
- # Main title of streamlit application
24
- main_title_cfg = """<div><h1 style="color:#FF64DA; text-align:center; font-size:40px;
25
- font-family: 'Archivo', sans-serif; margin-top:-50px;margin-bottom:20px;">
26
- Ultralytics YOLO Streamlit Application
27
- </h1></div>"""
28
-
29
- # Subtitle of streamlit application
30
- sub_title_cfg = """<div><h4 style="color:#042AFF; text-align:center;
31
- font-family: 'Archivo', sans-serif; margin-top:-15px; margin-bottom:50px;">
32
- Experience real-time object detection on your webcam with the power of Ultralytics YOLO! 🚀</h4>
33
- </div>"""
34
-
35
- # Set html page configuration
36
- st.set_page_config(page_title="Ultralytics Streamlit App", layout="wide", initial_sidebar_state="auto")
37
-
38
- # Append the custom HTML
39
- st.markdown(menu_style_cfg, unsafe_allow_html=True)
40
- st.markdown(main_title_cfg, unsafe_allow_html=True)
41
- st.markdown(sub_title_cfg, unsafe_allow_html=True)
42
-
43
- # Add ultralytics logo in sidebar
44
- with st.sidebar:
45
- logo = "https://raw.githubusercontent.com/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg"
46
- st.image(logo, width=250)
47
-
48
- # Add elements to vertical setting menu
49
- st.sidebar.title("User Configuration")
50
-
51
- # Add video source selection dropdown
52
- source = st.sidebar.selectbox(
53
- "Video",
54
- ("webcam", "video"),
55
- )
56
-
57
- vid_file_name = ""
58
- if source == "video":
59
- vid_file = st.sidebar.file_uploader("Upload Video File", type=["mp4", "mov", "avi", "mkv"])
60
- if vid_file is not None:
61
- g = io.BytesIO(vid_file.read()) # BytesIO Object
62
- vid_location = "ultralytics.mp4"
63
- with open(vid_location, "wb") as out: # Open temporary file as bytes
64
- out.write(g.read()) # Read bytes into file
65
- vid_file_name = "ultralytics.mp4"
66
- elif source == "webcam":
67
- vid_file_name = 0
68
-
69
- # Add dropdown menu for model selection
70
- available_models = [x.replace("yolo", "YOLO") for x in GITHUB_ASSETS_STEMS if x.startswith("yolo11")]
71
- if model:
72
- available_models.insert(0, model.split(".pt")[0]) # insert model without suffix as *.pt is added later
73
-
74
- selected_model = st.sidebar.selectbox("Model", available_models)
75
- with st.spinner("Model is downloading..."):
76
- model = YOLO(f"{selected_model.lower()}.pt") # Load the YOLO model
77
- class_names = list(model.names.values()) # Convert dictionary to list of class names
78
- st.success("Model loaded successfully!")
79
-
80
- # Multiselect box with class names and get indices of selected classes
81
- selected_classes = st.sidebar.multiselect("Classes", class_names, default=class_names[:3])
82
- selected_ind = [class_names.index(option) for option in selected_classes]
83
-
84
- if not isinstance(selected_ind, list): # Ensure selected_options is a list
85
- selected_ind = list(selected_ind)
86
-
87
- enable_trk = st.sidebar.radio("Enable Tracking", ("Yes", "No"))
88
- conf = float(st.sidebar.slider("Confidence Threshold", 0.0, 1.0, 0.25, 0.01))
89
- iou = float(st.sidebar.slider("IoU Threshold", 0.0, 1.0, 0.45, 0.01))
90
-
91
- col1, col2 = st.columns(2)
92
- org_frame = col1.empty()
93
- ann_frame = col2.empty()
94
-
95
- fps_display = st.sidebar.empty() # Placeholder for FPS display
96
-
97
- if st.sidebar.button("Start"):
98
- videocapture = cv2.VideoCapture(vid_file_name) # Capture the video
99
-
100
- if not videocapture.isOpened():
101
- st.error("Could not open webcam.")
102
-
103
- stop_button = st.button("Stop") # Button to stop the inference
104
-
105
- while videocapture.isOpened():
106
- success, frame = videocapture.read()
107
- if not success:
108
- st.warning("Failed to read frame from webcam. Please make sure the webcam is connected properly.")
109
- break
110
-
111
- prev_time = time.time() # Store initial time for FPS calculation
112
-
113
- # Store model predictions
114
- if enable_trk == "Yes":
115
- results = model.track(frame, conf=conf, iou=iou, classes=selected_ind, persist=True)
116
- else:
117
- results = model(frame, conf=conf, iou=iou, classes=selected_ind)
118
- annotated_frame = results[0].plot() # Add annotations on frame
119
-
120
- # Calculate model FPS
121
- curr_time = time.time()
122
- fps = 1 / (curr_time - prev_time)
123
-
124
- # display frame
125
- org_frame.image(frame, channels="BGR")
126
- ann_frame.image(annotated_frame, channels="BGR")
127
-
128
- if stop_button:
129
- videocapture.release() # Release the capture
130
- torch.cuda.empty_cache() # Clear CUDA memory
131
- st.stop() # Stop streamlit app
132
-
133
- # Display FPS in sidebar
134
- fps_display.metric("FPS", f"{fps:.2f}")
135
-
136
- # Release the capture
137
- videocapture.release()
138
-
139
- # Clear CUDA memory
140
- torch.cuda.empty_cache()
141
-
142
- # Destroy window
143
- cv2.destroyAllWindows()
144
-
145
-
146
- # Main function call
147
- if __name__ == "__main__":
148
- inference()
File without changes