ultralytics 8.3.54 New Streamlit inference Solution (#18316)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Signed-off-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
5b76bed7d0
commit
51026a9a4a
13 changed files with 251 additions and 188 deletions
|
|
@ -18,7 +18,7 @@
|
|||
[](https://www.pepy.tech/projects/ultralytics)
|
||||
[](https://pypi.org/project/ultralytics/)
|
||||
|
||||
To install the ultralytics package in developer mode, ensure you have Git and Python 3 installed on your system. Then, follow these steps:
|
||||
To install the Ultralytics package in developer mode, ensure you have Git and Python 3 installed on your system. Then, follow these steps:
|
||||
|
||||
1. Clone the ultralytics repository to your local machine using Git:
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ To install the ultralytics package in developer mode, ensure you have Git and Py
|
|||
pip install -e '.[dev]'
|
||||
```
|
||||
|
||||
- This command installs the ultralytics package along with all development dependencies, allowing you to modify the package code and have the changes immediately reflected in your Python environment.
|
||||
- This command installs the Ultralytics package along with all development dependencies, allowing you to modify the package code and have the changes immediately reflected in your Python environment.
|
||||
|
||||
## 🚀 Building and Serving Locally
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,9 @@ Streamlit makes it simple to build and deploy interactive web applications. Comb
|
|||
=== "CLI"
|
||||
|
||||
```bash
|
||||
yolo streamlit-predict
|
||||
yolo solutions inference
|
||||
|
||||
yolo solutions inference model="path/to/model/file.pt"
|
||||
```
|
||||
|
||||
=== "Python"
|
||||
|
|
@ -51,7 +53,11 @@ Streamlit makes it simple to build and deploy interactive web applications. Comb
|
|||
```python
|
||||
from ultralytics import solutions
|
||||
|
||||
solutions.inference()
|
||||
inf = solutions.Inference(
|
||||
model="yolo11n.pt", # You can use any model that Ultralytics support, i.e. YOLO11, or custom trained model
|
||||
)
|
||||
|
||||
inf.inference()
|
||||
|
||||
### Make sure to run the file using command `streamlit run <file-name.py>`
|
||||
```
|
||||
|
|
@ -67,8 +73,11 @@ You can optionally supply a specific model in Python:
|
|||
```python
|
||||
from ultralytics import solutions
|
||||
|
||||
# Pass a model as an argument
|
||||
solutions.inference(model="path/to/model.pt")
|
||||
inf = solutions.Inference(
|
||||
model="yolo11n.pt", # You can use any model that Ultralytics support, i.e. YOLO11, YOLOv10
|
||||
)
|
||||
|
||||
inf.inference()
|
||||
|
||||
### Make sure to run the file using command `streamlit run <file-name.py>`
|
||||
```
|
||||
|
|
@ -111,7 +120,11 @@ Then, you can create a basic Streamlit application to run live inference:
|
|||
```python
|
||||
from ultralytics import solutions
|
||||
|
||||
solutions.inference()
|
||||
inf = solutions.Inference(
|
||||
model="yolo11n.pt", # You can use any model that Ultralytics support, i.e. YOLO11, YOLOv10
|
||||
)
|
||||
|
||||
inf.inference()
|
||||
|
||||
### Make sure to run the file using command `streamlit run <file-name.py>`
|
||||
```
|
||||
|
|
@ -119,7 +132,7 @@ Then, you can create a basic Streamlit application to run live inference:
|
|||
=== "CLI"
|
||||
|
||||
```bash
|
||||
yolo streamlit-predict
|
||||
yolo solutions inference
|
||||
```
|
||||
|
||||
For more details on the practical setup, refer to the [Streamlit Application Code section](#streamlit-application-code) of the documentation.
|
||||
|
|
|
|||
|
|
@ -51,10 +51,6 @@ keywords: Ultralytics, YOLO, configuration, cfg2dict, get_cfg, check_cfg, save_d
|
|||
|
||||
<br><br><hr><br>
|
||||
|
||||
## ::: ultralytics.cfg.handle_streamlit_inference
|
||||
|
||||
<br><br><hr><br>
|
||||
|
||||
## ::: ultralytics.cfg.parse_key_value_pair
|
||||
|
||||
<br><br><hr><br>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,6 @@ keywords: Ultralytics, YOLOv8, live inference, real-time object detection, Strea
|
|||
|
||||
<br>
|
||||
|
||||
## ::: ultralytics.solutions.streamlit_inference.inference
|
||||
## ::: ultralytics.solutions.streamlit_inference.Inference
|
||||
|
||||
<br><br>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue