Views
No views yet
1import requests
2from PIL import Image
3from transformers import pipeline
4
5pipe = pipeline(
6 "image-classification",
7 model="pszemraj/convnextv2-nano-22k-384-boulderspot",
8)
9
10url = "https://huggingface.co/pszemraj/convnextv2-nano-22k-384-boulderspot/resolve/main/test_img_magic_wood.png?download=true"
11image = Image.open(requests.get(url, stream=True).raw)
12result = pipe(image)[0]
13print(result)
14# image.show()| Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 | Precision | Recall | Matthews Correlation |
|---|---|---|---|---|---|---|---|---|
| 0.1102 | 1.0 | 203 | 0.0431 | 0.9839 | 0.9840 | 0.9841 | 0.9839 | 0.8590 |
| 0.0559 | 2.0 | 406 | 0.0476 | 0.9839 | 0.9845 | 0.9858 | 0.9839 | 0.8709 |
| 0.0402 | 3.0 | 609 | 0.0464 | 0.9810 | 0.9817 | 0.9831 | 0.9810 | 0.8468 |
| 0.0334 | 4.0 | 813 | 0.0348 | 0.9868 | 0.9869 | 0.9870 | 0.9868 | 0.8846 |
| 0.0445 | 4.99 | 1015 | 0.0340 | 0.9883 | 0.9883 | 0.9883 | 0.9883 | 0.8962 |