Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing

  • Log In
  • Sign Up

apple
/
DFN-public

Zero-Shot Image Classification
Transformers
PyTorch
clip
Model card Files Files and versions
xet
Community
5

Instructions to use apple/DFN-public with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use apple/DFN-public with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("zero-shot-image-classification", model="apple/DFN-public")
    pipe(
        "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png",
        candidate_labels=["animals", "humans", "landscape"],
    )
    # Load model directly
    from transformers import AutoProcessor, AutoModelForZeroShotImageClassification
    
    processor = AutoProcessor.from_pretrained("apple/DFN-public")
    model = AutoModelForZeroShotImageClassification.from_pretrained("apple/DFN-public")
  • Notebooks
  • Google Colab
  • Kaggle
DFN-public
609 MB
Ctrl+K
Ctrl+K
  • 3 contributors
History: 7 commits
pcuenq's picture
pcuenq HF Staff
AMLR license (#2)
fc7f7f8 verified about 1 year ago
  • .gitattributes
    1.52 kB
    initial commit almost 2 years ago
  • LICENSE
    5.82 kB
    Update LICENSE about 1 year ago
  • README.md
    1.04 kB
    AMLR license (#2) about 1 year ago
  • config.json
    4.43 kB
    Upload 2 files almost 2 years ago
  • merges.txt
    525 kB
    Upload 5 files almost 2 years ago
  • pytorch_model.bin

    Detected Pickle imports (4)

    • "torch.FloatStorage",
    • "collections.OrderedDict",
    • "torch._utils._rebuild_tensor_v2",
    • "torch.LongStorage"

    What is a pickle import?

    605 MB
    xet
    Upload 2 files almost 2 years ago
  • special_tokens_map.json
    472 Bytes
    Upload 5 files almost 2 years ago
  • tokenizer.json
    2.22 MB
    Upload 5 files almost 2 years ago
  • tokenizer_config.json
    806 Bytes
    Upload 5 files almost 2 years ago
  • vocab.json
    862 kB
    Upload 5 files almost 2 years ago