@@ -49,8 +49,8 @@ from PIL import Image
|
|||||||
|
|
||||||
from transformers import AutoProcessor, OmDetTurboForObjectDetection
|
from transformers import AutoProcessor, OmDetTurboForObjectDetection
|
||||||
|
|
||||||
processor = AutoProcessor.from_pretrained("omlab/omdet-turbo-tiny")
|
processor = AutoProcessor.from_pretrained("omlab/omdet-turbo-swin-tiny-hf")
|
||||||
model = OmDetTurboForObjectDetection.from_pretrained("omlab/omdet-turbo-tiny")
|
model = OmDetTurboForObjectDetection.from_pretrained("omlab/omdet-turbo-swin-tiny-hf")
|
||||||
|
|
||||||
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
||||||
image = Image.open(requests.get(url, stream=True).raw)
|
image = Image.open(requests.get(url, stream=True).raw)
|
||||||
|
|||||||
@@ -134,10 +134,10 @@ class OmDetTurboConfig(PretrainedConfig):
|
|||||||
```python
|
```python
|
||||||
>>> from transformers import OmDetTurboConfig, OmDetTurboForObjectDetection
|
>>> from transformers import OmDetTurboConfig, OmDetTurboForObjectDetection
|
||||||
|
|
||||||
>>> # Initializing a OmDet-Turbo omlab/omdet-turbo-tiny style configuration
|
>>> # Initializing a OmDet-Turbo omlab/omdet-turbo-swin-tiny-hf style configuration
|
||||||
>>> configuration = OmDetTurboConfig()
|
>>> configuration = OmDetTurboConfig()
|
||||||
|
|
||||||
>>> # Initializing a model (with random weights) from the omlab/omdet-turbo-tiny style configuration
|
>>> # Initializing a model (with random weights) from the omlab/omdet-turbo-swin-tiny-hf style configuration
|
||||||
>>> model = OmDetTurboForObjectDetection(configuration)
|
>>> model = OmDetTurboForObjectDetection(configuration)
|
||||||
|
|
||||||
>>> # Accessing the model configuration
|
>>> # Accessing the model configuration
|
||||||
|
|||||||
@@ -1709,8 +1709,8 @@ class OmDetTurboForObjectDetection(OmDetTurboPreTrainedModel):
|
|||||||
|
|
||||||
>>> from transformers import AutoProcessor, OmDetTurboForObjectDetection
|
>>> from transformers import AutoProcessor, OmDetTurboForObjectDetection
|
||||||
|
|
||||||
>>> processor = AutoProcessor.from_pretrained("omlab/omdet-turbo-tiny")
|
>>> processor = AutoProcessor.from_pretrained("omlab/omdet-turbo-swin-tiny-hf")
|
||||||
>>> model = OmDetTurboForObjectDetection.from_pretrained("omlab/omdet-turbo-tiny")
|
>>> model = OmDetTurboForObjectDetection.from_pretrained("omlab/omdet-turbo-swin-tiny-hf")
|
||||||
|
|
||||||
>>> url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
>>> url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
||||||
>>> image = Image.open(requests.get(url, stream=True).raw)
|
>>> image = Image.open(requests.get(url, stream=True).raw)
|
||||||
|
|||||||
Reference in New Issue
Block a user