|
11 | 11 |
|
12 | 12 | # Keras Image Models
|
13 | 13 |
|
14 |
| -## Description |
| 14 | +## Introduction |
15 | 15 |
|
16 | 16 | **K**eras **Im**age **M**odels (`kimm`) is a collection of image models, blocks and layers written in Keras 3. The goal is to offer SOTA models with pretrained weights in a user-friendly manner.
|
17 | 17 |
|
| 18 | +## Features |
| 19 | + |
| 20 | +- 🚀 Almost all models have pre-trained weights on ImageNet |
| 21 | + |
| 22 | + > **Note:** |
| 23 | + > The accuracy of the exported models can be found at [results-imagenet.csv (timm)](https://github.com/huggingface/pytorch-image-models/blob/main/results/results-imagenet.csv) |
| 24 | +
|
| 25 | +- 🧰 All models have a common API identical to `keras.applications.*` |
| 26 | + |
| 27 | + ```python |
| 28 | + model = kimm.models.RegNetY002( |
| 29 | + input_tensor: keras.KerasTensor = None, |
| 30 | + input_shape: typing.Optional[typing.Sequence[int]] = None, |
| 31 | + include_preprocessing: bool = True, |
| 32 | + include_top: bool = True, |
| 33 | + pooling: typing.Optional[str] = None, |
| 34 | + dropout_rate: float = 0.0, |
| 35 | + classes: int = 1000, |
| 36 | + classifier_activation: str = "softmax", |
| 37 | + weights: typing.Optional[str] = "imagenet", |
| 38 | + name: str = "RegNetY002", |
| 39 | + ) |
| 40 | + ``` |
| 41 | + |
| 42 | +- 🔥 All models support feature extraction (`feature_extractor=True`) |
| 43 | + |
| 44 | + ```python |
| 45 | + from keras import random |
| 46 | + import kimm |
| 47 | + |
| 48 | + model = kimm.models.ConvNeXtAtto(feature_extractor=True) |
| 49 | + x = random.uniform([1, 224, 224, 3]) |
| 50 | + y = model(x, training=False) |
| 51 | + # y becomes a dict |
| 52 | + for k, v in y.items(): |
| 53 | + print(k, v.shape) |
| 54 | + ``` |
| 55 | + |
18 | 56 | ## Installation
|
19 | 57 |
|
20 | 58 | ```bash
|
21 |
| -# In a working [jax/tensorflow/torch/numpy] backend environment |
22 | 59 | pip install keras kimm
|
23 | 60 | ```
|
24 | 61 |
|
|
0 commit comments