D-FINE icon indicating copy to clipboard operation
D-FINE copied to clipboard

does this nano model works with 640*640 img size can i give 1280*736 image size

Open manoj-samal opened this issue 8 months ago • 1 comments

does this nano model works with 640640 img size can i give 1280736 image size . if yes where is the parameter in config where i can change the img size

manoj-samal avatar Mar 26 '25 16:03 manoj-samal

The quick answer is yes. The dimensions must be multiples of 32. To change the image size, you should change this file https://github.com/Peterande/D-FINE/blob/4a1f73a8bcfac736a88abde9596d87f116d780a7/configs/dfine/include/dataloader.yml#L11

and also this https://github.com/Peterande/D-FINE/blob/4a1f73a8bcfac736a88abde9596d87f116d780a7/configs/dfine/include/dataloader.yml#L22

Now, be careful, because D-FINE was designed to process square images.

Apart from the transformations in this file https://github.com/Peterande/D-FINE/blob/4a1f73a8bcfac736a88abde9596d87f116d780a7/configs/dfine/include/dataloader.yml#L2-L14

D-FINE also applies random scaling here https://github.com/Peterande/D-FINE/blob/4a1f73a8bcfac736a88abde9596d87f116d780a7/src/data/dataloader.py#L106-L122

You get the variable self.scales from this function https://github.com/Peterande/D-FINE/blob/4a1f73a8bcfac736a88abde9596d87f116d780a7/src/data/dataloader.py#L80-L85

For your specific case, the generate_scales function will produce the following shapes

  • (960, 552) -> no
  • (992, 570) -> no
  • (1024, 588) -> no
  • (1056, 607) -> no
  • (1088, 625) -> no
  • (1120, 644) -> no
  • (1152, 662) -> no
  • (1184, 680) -> no
  • (1216, 699) -> no
  • (1248, 717) -> no
  • (1280, 736) -> yes
  • (1280, 736) -> yes
  • (1280, 736) -> yes
  • (1600, 919) -> no
  • (1568, 901) -> no
  • (1536, 883) -> no
  • (1504, 864) -> yes
  • (1472, 846) -> no
  • (1440, 827) -> no
  • (1408, 809) -> no
  • (1376, 791) -> no
  • (1344, 772) -> no
  • (1312, 754) -> no where yes means both dimensions are divisible by 32 and no means that at least one dimension is not divisible by 32.

SebastianJanampa avatar May 03 '25 17:05 SebastianJanampa