Skip to content

Modify fcnn.predict to Accept Image NumPy Array Instead of Image Path #93

@Abbsalehi

Description

@Abbsalehi

Description:

Dear contributors,

Thanks for your all efforts, currently, the fcnn.predict function in FasterRCNN accepts just an image path as input. This approach is limiting, especially in workflows where images are already loaded into memory as NumPy arrays for preprocessing or augmentation. Allowing fcnn.predict to accept a NumPy array directly would enhance flexibility and efficiency, avoiding the need for redundant disk I/O operations.

Proposed change:

Modify the fcnn.predict method to accept a NumPy array representing the image, in addition to the existing option of providing an image path. The method should be able to detect the input type and handle it accordingly. For instance:

If the input is a string, assume it’s a file path and load the image as currently done.
If the input is a NumPy array, use the array directly for prediction.

image_array = np.array([...])  # Image loaded as a NumPy array

[bbx, _, score] = fcnn.predict(image_array,...)

I would highly appreciate it if you could modify this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions