Skip to content

Commit

Permalink
update predict docs (#723)
Browse files Browse the repository at this point in the history
  • Loading branch information
fcakyon authored Nov 13, 2022
1 parent b5156b0 commit f55da77
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions docs/predict.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

```python
from sahi.predict import get_sliced_prediction
from sahi.model import MmdetDetectionModel, Yolov5DetectionModel, Detectron2DetectionModel
from sahi import AutoDetectionModel

# init any model
detection_model = MmdetDetectionModel(...)
detection_model = Yolov5DetectionModel(...)
detection_model = Detectron2DetectionModel(...)
detection_model = AutoDetectionModel.from_pretrained(model_type='mmdet',...) # for MMDetection models
detection_model = AutoDetectionModel.from_pretrained(model_type='yolov5',...) # for YOLOv5 models
detection_model = AutoDetectionModel.from_pretrained(model_type='huggingface',...) # for HuggingFace detection models
detection_model = AutoDetectionModel.from_pretrained(model_type='torchvision',...) # for Torchvision detection models

# get sliced prediction result
result = get_sliced_prediction(
Expand All @@ -27,12 +28,10 @@ result = get_sliced_prediction(

```python
from sahi.predict import get_prediction
from sahi.model import MmdetDetectionModel, Yolov5DetectionModel, Detectron2DetectionModel
from sahi import AutoDetectionModel

# init any model
detection_model = MmdetDetectionModel(...)
detection_model = Yolov5DetectionModel(...)
detection_model = Detectron2DetectionModel(...)
# init a model
detection_model = AutoDetectionModel.from_pretrained(...)

# get standard prediction result
result = get_prediction(
Expand All @@ -46,12 +45,10 @@ result = get_prediction(

```python
from sahi.predict import predict
from sahi.model import MmdetDetectionModel, Yolov5DetectionModel, Detectron2DetectionModel
from sahi import AutoDetectionModel

# init any model
detection_model = MmdetDetectionModel(...)
detection_model = Yolov5DetectionModel(...)
detection_model = Detectron2DetectionModel(...)
# init a model
detection_model = AutoDetectionModel.from_pretrained(...)

# get batch predict result
result = predict(
Expand All @@ -71,4 +68,4 @@ result = predict(
export_crop=False,
)

```
```

0 comments on commit f55da77

Please sign in to comment.