Instructions to use facebook/dinov2-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/dinov2-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-feature-extraction", model="facebook/dinov2-base")# Load model directly from transformers import AutoImageProcessor, AutoModel processor = AutoImageProcessor.from_pretrained("facebook/dinov2-base") model = AutoModel.from_pretrained("facebook/dinov2-base") - Notebooks
- Google Colab
- Kaggle
Mismatch in image preprocessor parameters
#7
by mwcampbell - opened
I noticed that the image preprocessor is configured to resize the image such that the shortest edge is 256 pixels, but then crop the image to 224x224. Is this deliberate? In other words, is it intended that part of the image will always be cut off even along the shortest edge?
Hi,
I took this from the original implementation, which can be found here: https://github.com/facebookresearch/dinov2/blob/main/dinov2/data/transforms.py#L77