Skip to content

Dimensions of character boxes out of bounds on multiple epochs #101

Open
@vasusharma7

Description

@vasusharma7

Found a small bug: On traversing through same image in multiple epochs and hence doing random_scaling every time, the coordinates in the previous epch get mutliplied by the scale factor every time, thus the dimensions of the character boxes overshoots the image dimension and hence no bounding boxes or region or affinity boxes made for that epoch.

Reason : The list indexing and slicing done in load_image_gt_and_confidencemask function in Synth80k class doesn't make a deep copy of the charbox coordinates and hence the same coordinates get modified.

Solution : using deepcopy for making list copy at line

_charbox = copy.deepcopy(self.charbox[index]).transpose((2, 1, 0))

_charbox = self.charbox[index].transpose((2, 1, 0))

Although I found it working on master branch:

_charbox = self.charbox[index].transpose((2, 1, 0))

As a result in say 10th epoch, all we have is this image as output with no character boxes:
ballet_106_0

After fixing with deepcopy, then it produces this after 10 epochs and random scaling :
ballet_106_0

@backtime92 . Pardon me for tagging here but if this is not fixed already(excuse me if that is already fixed), this can certainly increase accuracy since if this is not done, then in the later epochs, all that the network is seeing is a plain image with no input character regions.

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