Skip to content

11.2 Detecting Multiple Images -- Issue with the format_img function #84

@ValentinDelpy

Description

@ValentinDelpy

Hi,
We are trying to implement the Notebook, and we have the error following : "NameError: name 'format_img' is not defined", at the line "X, ratio = format_img(img,c)", of the following code,

`img = cv2.imread('data/cat_dog.jpg')
X, ratio = format_img(img, c)

if K.image_dim_ordering() == 'tf':
X = np.transpose(X, (0, 2, 3, 1))

y1, y2, f = model_rpn.predict(X)
r = keras_frcnn.roi_helpers.rpn_to_roi(y1, y2, c, K.image_dim_ordering(), overlap_thresh=0.7)
roi_count = R.shape[0] // c.num_rois
r2 = np.zeros((roi_count * c.num_rois, r.shape[1]))
r2 = r[:r2.shape[0],:r2.shape[1]]
r2 = np.reshape(r2, (roi_count, c.num_rois, r.shape[1]))
`

Is the function defined somewhere in the project ? We can't retrieve it, and can't solve this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions