From 31ca4897bbff517156f7730b9562ac30061b39d5 Mon Sep 17 00:00:00 2001 From: Laurent Mazare Date: Fri, 20 Oct 2023 09:08:39 +0100 Subject: [PATCH] Readme updates. (#1134) --- README.md | 15 +++++++-------- candle-examples/examples/vit/README.md | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 candle-examples/examples/vit/README.md diff --git a/README.md b/README.md index fd3a9fbf..03c2a1f5 100644 --- a/README.md +++ b/README.md @@ -130,8 +130,11 @@ And then head over to -## Useful Libraries -- [`candle-lora`](https://github.com/EricLBuehler/candle-lora) provides a LoRA implementation that conforms to the official `peft` implementation. +## Useful External Resources +- [`candle-tutorial`](https://github.com/ToluClassics/candle-tutorial): a + very detailed tutorial showing how to convert a PyTorch model to Candle. +- [`candle-lora`](https://github.com/EricLBuehler/candle-lora): a LoRA implementation + that conforms to the official `peft` implementation. If you have an addition to this list, please submit a pull request. @@ -163,12 +166,8 @@ If you have an addition to this list, please submit a pull request. - Stable Diffusion v1.5, v2.1, XL v1.0. - Wurstchen v2. - Computer Vision Models. - - DINOv2. - - ConvMixer. - - EfficientNet. - - ResNet-18/34/50/101/152. - - yolo-v3. - - yolo-v8. + - DINOv2, ConvMixer, EfficientNet, ResNet, ViT. + - yolo-v3, yolo-v8. - Segment-Anything Model (SAM). - File formats: load models from safetensors, npz, ggml, or PyTorch files. - Serverless (on CPU), small and fast deployments. diff --git a/candle-examples/examples/vit/README.md b/candle-examples/examples/vit/README.md new file mode 100644 index 00000000..42e9a6a7 --- /dev/null +++ b/candle-examples/examples/vit/README.md @@ -0,0 +1,20 @@ +# candle-vit + +Vision Transformer (ViT) model implementation following the lines of +[vit-base-patch16-224](https://huggingface.co/google/vit-base-patch16-224) +This uses a classification head trained on the ImageNet dataset and returns the +probabilities for the top-5 classes. + +## Running an example + +``` +$ cargo run --example vit --release -- --image tiger.jpg + +loaded image Tensor[dims 3, 224, 224; f32] +model built +tiger, Panthera tigris : 100.00% +tiger cat : 0.00% +jaguar, panther, Panthera onca, Felis onca: 0.00% +leopard, Panthera pardus: 0.00% +lion, king of beasts, Panthera leo: 0.00% +```