Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
Add max size assert in DETRdemo (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmassa authored Jul 31, 2020
1 parent 549d882 commit f6bc5d2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion notebooks/detr_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,11 @@
" # mean-std normalize the input image (batch-size: 1)\n",
" img = transform(im).unsqueeze(0)\n",
"\n",
" # demo model only support by default images with aspect ratio between 0.5 and 2\n",
" # if you want to use images with an aspect ratio outside this range\n",
" # rescale your image so that the maximum size is at most 1333 for best results\n",
" assert img.shape[-2] <= 1600 and img.shape[-1] <= 1600, 'demo model only supports images up to 1600 pixels on each side'\n",
"\n",
" # propagate through the model\n",
" outputs = model(img)\n",
"\n",
Expand Down Expand Up @@ -698,4 +703,4 @@
]
}
]
}
}

0 comments on commit f6bc5d2

Please sign in to comment.