Skip to content

Missing last row and column of image in result of RandomCrop in data_loading_tutorial #876

Closed
@AntonDemchenko

Description

@AntonDemchenko

Result of cropping never contains last column and last row of image pixels.

Method np.random.randint(low, high) returns value from low (inclusive) and to high(exclusive) (See documentation)
Therefore variable top takes value from 0 to h - new_h - 1 inclusive.
Maximal bottom equals (h - new_h - 1) + new_h - 1 = h - 2 but not h - 1.
Row indexed h - 1 never gets into result.
Similarly, column indexed w - 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    data loadingIssues relating to the data loading tutorialdocathon-h1-2023A label for the docathon in H1 2023medium

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions