Last active
October 25, 2023 16:43
-
-
Save Tob-iee/b003c9ba26046e0c4bdbdb7ebdde64de to your computer and use it in GitHub Desktop.
Load DETR’s image processor, encode the images and reformat the annotations with the image processor.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load transformer image processor for DetrModel | |
checkpoint = "facebook/detr-resnet-50" | |
image_processor = AutoImageProcessor.from_pretrained(checkpoint) | |
# converting targets to DETR format & resizing + normalization both image & target | |
encoding=image_processor(images=images_trans, annotations=targets, return_tensors="pt") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment