Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow model.predict to handle numpy array inputs #350

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Anirudh2112
Copy link

Description

This PR adds support for numpy array inputs to the model.predict function, fixing issue #346. Previously, model.predict would fail when trying to process numpy array inputs in segmentation models, despite working with file paths. This change enables consistent behavior across all input types.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How has this change been tested, please provide a testcase or example of how you tested the change?

Added comprehensive unit tests in test_instance_segmentation.py:

  1. Test with basic numpy array image
  2. Verify prediction group output
  3. Validate request formatting
  4. Check API response handling

Example test case:

image_array = np.zeros((100, 100, 3), dtype=np.uint8)
image_array[30:70, 30:70] = 255
result = model.predict(image_array)

Docs

  • Updated function docstring to include numpy array type

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.

1 participant