Skip to content

[DO NOT MERGE] RFC Model Contract#1027

Draft
rajeshgangireddy wants to merge 7 commits into
open-edge-platform:mainfrom
rajeshgangireddy:rfc_model_contract
Draft

[DO NOT MERGE] RFC Model Contract#1027
rajeshgangireddy wants to merge 7 commits into
open-edge-platform:mainfrom
rajeshgangireddy:rfc_model_contract

Conversation

@rajeshgangireddy

Copy link
Copy Markdown
Contributor

to discuss only, DO NOT MERGE.
Model, Model capabilties and DeviceList


### `TorchModel` — torch-aware intermediate

**Currently:** All torch models inherit `Model(nn.Module)` directly. There's no intermediate class — each model independently implements predict() returning `list[dict[str, torch.Tensor]]`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like how AI is shouting about the Torch problem on every corner 😂

@mpryahin

Copy link
Copy Markdown
Contributor

Thanks @rajeshgangireddy! I like your proposal and I fully aligned on it.

bboxes: np.ndarray | None = None # (N, 4) xyxy
points: np.ndarray | None = None # (N, K, 2)
scores: np.ndarray | None = None # (N,)
categories: list[str] = field(default_factory=lambda: ["object"])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we should keep this default factory, if later in the code we use loops like

for category_id, category in zip(sample.category_ids, sample.categories)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants