-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #268 from roboflow/feature/yolo-world
YOLO-World
- Loading branch information
Showing
32 changed files
with
580 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from typing import List, Optional | ||
|
||
from pydantic import Field | ||
|
||
from inference.core.entities.requests.inference import CVInferenceRequest | ||
|
||
|
||
class DynamicClassBaseInferenceRequest(CVInferenceRequest): | ||
"""Request for zero-shot object detection models (with dynamic class lists). | ||
Attributes: | ||
text (List[str]): A list of strings. | ||
""" | ||
|
||
model_id: Optional[str] = Field(None) | ||
text: List[str] = Field( | ||
examples=[["person", "dog", "cat"]], | ||
description="A list of strings", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,15 @@ | ||
from typing import List, Optional | ||
|
||
from pydantic import Field | ||
from inference.core.entities.requests.dynamic_class_base import ( | ||
DynamicClassBaseInferenceRequest, | ||
) | ||
|
||
from inference.core.entities.requests.inference import CVInferenceRequest | ||
|
||
|
||
class GroundingDINOInferenceRequest(CVInferenceRequest): | ||
class GroundingDINOInferenceRequest(DynamicClassBaseInferenceRequest): | ||
"""Request for Grounding DINO zero-shot predictions. | ||
Attributes: | ||
text (List[str]): A list of strings. | ||
""" | ||
|
||
model_id: Optional[str] = Field(None) | ||
text: List[str] = Field( | ||
examples=[["person", "dog", "cat"]], | ||
description="A list of strings", | ||
) | ||
grounding_dino_version_id: Optional[str] = "default" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from typing import List, Optional | ||
|
||
from inference.core.entities.requests.dynamic_class_base import ( | ||
DynamicClassBaseInferenceRequest, | ||
) | ||
from inference.core.models.defaults import DEFAULT_CONFIDENCE | ||
|
||
|
||
class YOLOWorldInferenceRequest(DynamicClassBaseInferenceRequest): | ||
"""Request for Grounding DINO zero-shot predictions. | ||
Attributes: | ||
text (List[str]): A list of strings. | ||
""" | ||
|
||
yolo_world_version_id: Optional[str] = "l" | ||
confidence: Optional[float] = DEFAULT_CONFIDENCE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.