Views
No views yet




precision recall f1-score support
dyed-lifted-polyps 0.95 0.93 0.94 60
dyed-resection-margins 0.97 0.95 0.96 64
esophagitis 0.93 0.79 0.85 67
normal-cecum 1.00 0.98 0.99 54
normal-pylorus 0.95 1.00 0.97 57
normal-z-line 0.82 0.93 0.87 67
polyps 0.92 0.92 0.92 52
ulcerative-colitis 0.93 0.95 0.94 59
accuracy 0.93 480
macro avg 0.93 0.93 0.93 480
weighted avg 0.93 0.93 0.93 4801from transformers import ViTFeatureExtractor, ViTForImageClassification
2from hugsvision.inference.VisionClassifierInference import VisionClassifierInference
3
4path = "mrm8488/vit-base-patch16-224_finetuned-kvasirv2-colonoscopy"
5
6
7classifier = VisionClassifierInference(
8 feature_extractor = ViTFeatureExtractor.from_pretrained(path),
9 model = ViTForImageClassification.from_pretrained(path),
10)
11
12img = "Your image path"
13label = classifier.predict(img_path=img)
14print("Predicted class:", label)Disclaimer: This model was trained for research only
Created by Manuel Romero/@mrm8488 | LinkedIn
Made with ♥ in Spain