NeuronZero
commited on
Commit
•
2e31111
1
Parent(s):
1dc1e8f
Update README.md
Browse files
README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
|
2 |
---
|
3 |
tags:
|
4 |
-
- autotrain
|
5 |
- image-classification
|
|
|
|
|
6 |
widget:
|
7 |
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/tiger.jpg
|
8 |
example_title: Tiger
|
@@ -12,11 +12,50 @@ widget:
|
|
12 |
example_title: Palace
|
13 |
datasets:
|
14 |
- Falah/Blood_8_classes_Dataset
|
|
|
|
|
15 |
---
|
16 |
|
17 |
-
# Model Trained Using AutoTrain
|
18 |
|
19 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
## Validation Metrics
|
22 |
No validation metrics available
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
tags:
|
|
|
3 |
- image-classification
|
4 |
+
- auto-train
|
5 |
+
- vision
|
6 |
widget:
|
7 |
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/tiger.jpg
|
8 |
example_title: Tiger
|
|
|
12 |
example_title: Palace
|
13 |
datasets:
|
14 |
- Falah/Blood_8_classes_Dataset
|
15 |
+
license: apache-2.0
|
16 |
+
pipeline_tag: image-classification
|
17 |
---
|
18 |
|
|
|
19 |
|
20 |
+
# ResNet-50 v1.5
|
21 |
+
|
22 |
+
ResNet model pre-trained on ImageNet-1k at resolution 224x224. It was introduced in the paper [Deep Residual Learning for Image Recognition](https://arxiv.org/abs/1512.03385) by He et al.
|
23 |
+
|
24 |
+
Disclaimer: The team releasing ResNet did not write a model card for this model so this model card has been written by the Hugging Face team.
|
25 |
+
|
26 |
+
## Model description
|
27 |
+
|
28 |
+
ResNet (Residual Network) is a convolutional neural network that democratized the concepts of residual learning and skip connections. This enables to train much deeper models.
|
29 |
+
|
30 |
+
This is ResNet v1.5, which differs from the original model: in the bottleneck blocks which require downsampling, v1 has stride = 2 in the first 1x1 convolution, whereas v1.5 has stride = 2 in the 3x3 convolution. This difference makes ResNet50 v1.5 slightly more accurate (\~0.5% top1) than v1, but comes with a small performance drawback (~5% imgs/sec) according to [Nvidia](https://catalog.ngc.nvidia.com/orgs/nvidia/resources/resnet_50_v1_5_for_pytorch).
|
31 |
+
|
32 |
+
![model image](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/resnet_architecture.png)
|
33 |
+
|
34 |
|
35 |
## Validation Metrics
|
36 |
No validation metrics available
|
37 |
+
|
38 |
+
|
39 |
+
### How to use
|
40 |
+
|
41 |
+
Here is how to use this model to classify an image of :
|
42 |
+
|
43 |
+
```python
|
44 |
+
from transformers import AutoImageProcessor, ResNetForImageClassification
|
45 |
+
import torch
|
46 |
+
from datasets import load_dataset
|
47 |
+
|
48 |
+
dataset = load_dataset("huggingface/cats-image")
|
49 |
+
image = dataset["test"]["image"][0]
|
50 |
+
|
51 |
+
processor = AutoImageProcessor.from_pretrained("microsoft/resnet-50")
|
52 |
+
model = ResNetForImageClassification.from_pretrained("microsoft/resnet-50")
|
53 |
+
|
54 |
+
inputs = processor(image, return_tensors="pt")
|
55 |
+
|
56 |
+
with torch.no_grad():
|
57 |
+
logits = model(**inputs).logits
|
58 |
+
|
59 |
+
# model predicts one of the 1000 ImageNet classes
|
60 |
+
predicted_label = logits.argmax(-1).item()
|
61 |
+
print(model.config.id2label[predicted_label])
|