Skip to content

Commit

Permalink
Only pad if pad_size is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
xenova committed Sep 20, 2023
1 parent 5824968 commit e74844f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/processors.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ export class ImageFeatureExtractor extends FeatureExtractor {
let reshaped_input_size = [image.height, image.width];

// TODO is it okay to pad before rescaling/normalizing?
if (this.do_pad) {
if (this.do_pad && this.pad_size) {
let left = 0;
let right = this.pad_size.width - image.width;
let top = 0;
Expand Down

0 comments on commit e74844f

Please sign in to comment.