Update densenet_201_imagenet README.md

#1
Files changed (1) hide show
  1. README.md +55 -12
README.md CHANGED
@@ -1,15 +1,58 @@
1
  ---
2
  library_name: keras-hub
3
  ---
4
- This is a [`DenseNet` model](https://keras.io/api/keras_hub/models/dense_net) uploaded using the KerasHub library and can be used with JAX, TensorFlow, and PyTorch backends.
5
- This model is related to a `ImageClassifier` task.
6
-
7
- Model config:
8
- * **name:** dense_net_backbone
9
- * **trainable:** True
10
- * **stackwise_num_repeats:** [6, 12, 48, 32]
11
- * **compression_ratio:** 0.5
12
- * **growth_rate:** 32
13
- * **image_shape:** [None, None, 3]
14
-
15
- This model card has been generated automatically and should be completed by the model author. See [Model Cards documentation](https://huggingface.co/docs/hub/model-cards) for more information.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  library_name: keras-hub
3
  ---
4
+ This is a [`DenseNet` model](https://keras.io/api/keras_hub/models/densenet/) uploaded using the KerasHub library and can be used with JAX, TensorFlow, and PyTorch backends.
5
+ This model is related to an `ImageClassifier` task.
6
+
7
+ DenseNet is a convolution network which densely connects each layer to every other layer in a feed-forward fashion. The model was originally evaluated on four object recognition benchmark tasks (CIFAR-10, CIFAR-100, SVHN, and ImageNet). See the model card below for benchmarks, data sources, and intended use cases. This model is supported in both KerasCV and KerasHub. KerasCV will no longer be actively developed, so please try to use KerasHub.
8
+
9
+ Weights are released under the [3-Clause BSD License](https://github.com/liuzhuang13/DenseNet/blob/master/LICENSE). Keras model code is released under the [Apache 2 License](https://github.com/keras-team/keras-nlp/blob/master/LICENSE).
10
+
11
+ ## Links
12
+
13
+ * [DenseNet Quickstart Notebook: coming soon]()
14
+ * [DenseNet API Documentation](https://keras.io/api/keras_hub/models/densnet/)
15
+ * [DenseNet Model Card](https://github.com/liuzhuang13/DenseNet)
16
+
17
+ ## Installation
18
+
19
+ Keras and KerasHub can be installed with:
20
+
21
+ ```
22
+ pip install -U -q keras-hub
23
+ pip install -U -q keras
24
+ ```
25
+
26
+ Jax, TensorFlow, and Torch come preinstalled in Kaggle Notebooks. For instructions on installing them in another environment see the [Keras Getting Started](https://keras.io/getting_started/) page.
27
+
28
+ ## Presets
29
+
30
+ The following model checkpoints are provided by the Keras team. Weights have been ported from: https://huggingface.co/timm. Full code examples for each are available below.
31
+
32
+ | Preset name | Parameters | Description |
33
+ |-----------------------|------------|---------------|
34
+ | `densenet_121_imagenet` | 7037504 | DenseNet model with 121 layers. Trained on Imagenet 2012 classification task. |
35
+ | `densenet_169_imagenet` | 12642880 | DenseNet model with 169 layers. Trained on Imagenet 2012 classification task. |
36
+ | `densenet_201_imagenet` | 18321984 | DenseNet model with 201 layers. Trained on Imagenet 2012 classification task. |
37
+
38
+ ## Example Use
39
+
40
+ ```python
41
+ input_data = np.ones(shape=(8, 224, 224, 3))
42
+
43
+ # Pretrained backbone
44
+ model = keras_hub.models.DenseNetBackbone.from_preset("hf://keras/densenet_201_imagenet")
45
+ model(input_data)
46
+
47
+ # Randomly initialized backbone with a custom config
48
+ model = keras_hub.models.DenseNetBackbone(
49
+ stackwise_num_repeats=[6, 12, 24, 16],
50
+ )
51
+ model(input_data)
52
+
53
+ # Use densenet for image classification task
54
+ model = keras_hub.models.ImageClassifier.from_preset("hf://keras/densenet_201_imagenet")
55
+
56
+ # User Timm presets directly from HuggingFace
57
+ model = keras_hub.models.ImageClassifier.from_preset('hf://timm/densenet201.tv_in1k')
58
+ ```