Nuno-Tome commited on
Commit
c638ffa
·
1 Parent(s): 6de1e16

feat: reorganizar modelos em categorias e adicionar novos classificadores

Browse files

- Reorganizada lista de modelos em 20 categorias por tipo de classificação
- Adicionados 22 modelos novos do Hugging Face com sufxo " new"
- Atualizada função classify para remover sufixo antes de usar modelo

---
feat: reorganize models into categories and add new classifiers

- Reorganized model list into 20 categories by classification type
- Added 22 new Hugging Face models with " new" suffix
- Updated classify function to remove suffix before using model

Files changed (2) hide show
  1. app.py +85 -38
  2. contexto.md +3 -0
app.py CHANGED
@@ -7,48 +7,95 @@ MIN_ACEPTABLE_SCORE = 0.1
7
  MAX_N_LABELS = 5
8
  MODEL_2 = "nateraw/vit-age-classifier"
9
  MODELS = [
10
- "google/vit-base-patch16-224", #Classifição geral
11
- "nateraw/vit-age-classifier", #Classifição de idade
12
- "microsoft/resnet-50", #Classifição geral
13
- "Falconsai/nsfw_image_detection", #Classifição NSFW
14
- "cafeai/cafe_aesthetic", #Classifição de estética
15
- "microsoft/resnet-18", #Classifição geral
16
- "microsoft/resnet-34", #Classifição geral escolhida pelo copilot
17
- "microsoft/resnet-101", #Classifição geral escolhida pelo copilot
18
- "microsoft/resnet-152", #Classifição geral escolhida pelo copilot
19
- "microsoft/swin-tiny-patch4-window7-224",#Classifição geral
20
- "-- Reinstated on testing--",
21
- "microsoft/beit-base-patch16-224-pt22k-ft22k", #Classifição geral
22
- "-- New --",
23
- "-- Still in the testing process --",
24
- "facebook/convnext-large-224", #Classifição geral
25
- "timm/resnet50.a1_in1k", #Classifição geral
26
- "timm/mobilenetv3_large_100.ra_in1k", #Classifição geral
27
- "trpakov/vit-face-expression", #Classifição de expressão facial
28
- "rizvandwiki/gender-classification", #Classifição de gênero
29
- "#q-future/one-align", #Classifição geral
30
- "LukeJacob2023/nsfw-image-detector", #Classifição NSFW
31
- "vit-base-patch16-224-in21k", #Classifição geral
32
- "not-lain/deepfake", #Classifição deepfake
33
- "carbon225/vit-base-patch16-224-hentai", #Classifição hentai
34
- "facebook/convnext-base-224-22k-1k", #Classifição geral
35
- "facebook/convnext-large-224", #Classifição geral
36
- "facebook/convnext-tiny-224",#Classifição geral
37
- "nvidia/mit-b0", #Classifição geral
38
- "microsoft/resnet-18", #Classifição geral
39
- "microsoft/swinv2-base-patch4-window16-256", #Classifição geral
40
- "andupets/real-estate-image-classification", #Classifição de imóveis
41
- "timm/tf_efficientnetv2_s.in21k", #Classifição geral
42
  "timm/convnext_tiny.fb_in22k",
43
- "DunnBC22/vit-base-patch16-224-in21k_Human_Activity_Recognition", #Classifição de atividade humana
44
- "FatihC/swin-tiny-patch4-window7-224-finetuned-eurosat-watermark", #Classifição geral
45
- "aalonso-developer/vit-base-patch16-224-in21k-clothing-classifier", #Classifição de roupas
46
- "RickyIG/emotion_face_image_classification", #Classifição de emoções
47
- "shadowlilac/aesthetic-shadow" #Classifição de estética
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  ]
49
 
50
  def classify(image, model):
51
- classifier = pipeline("image-classification", model=model)
 
52
  result= classifier(image)
53
  return result
54
 
 
7
  MAX_N_LABELS = 5
8
  MODEL_2 = "nateraw/vit-age-classifier"
9
  MODELS = [
10
+ "-- General Image Classification --",
11
+ "google/vit-base-patch16-224",
12
+ "microsoft/resnet-50",
13
+ "microsoft/resnet-18",
14
+ "microsoft/resnet-34",
15
+ "microsoft/resnet-101",
16
+ "microsoft/resnet-152",
17
+ "microsoft/swin-tiny-patch4-window7-224",
18
+ "microsoft/swinv2-base-patch4-window16-256",
19
+ "microsoft/beit-base-patch16-224-pt22k-ft22k",
20
+ "facebook/convnext-large-224",
21
+ "facebook/convnext-base-224-22k-1k",
22
+ "facebook/convnext-tiny-224",
23
+ "nvidia/mit-b0",
24
+ "timm/resnet50.a1_in1k",
25
+ "timm/tf_efficientnetv2_s.in21k",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  "timm/convnext_tiny.fb_in22k",
27
+ "vit-base-patch16-224-in21k",
28
+ "facebook/deit-base-distilled-patch16-224 new",
29
+ "WinKawaks/vit-tiny-patch16-224 new",
30
+
31
+ "-- Age Classification --",
32
+ "nateraw/vit-age-classifier",
33
+
34
+ "-- NSFW Detection --",
35
+ "Falconsai/nsfw_image_detection",
36
+ "LukeJacob2023/nsfw-image-detector",
37
+ "carbon225/vit-base-patch16-224-hentai",
38
+ "Marqo/nsfw-image-detection-384 new",
39
+
40
+ "-- Aesthetic/Art Classification --",
41
+ "cafeai/cafe_aesthetic",
42
+ "shadowlilac/aesthetic-shadow",
43
+ "pixai-labs/pixai-tagger-v0.9 new",
44
+
45
+ "-- Face/Emotion Classification --",
46
+ "trpakov/vit-face-expression",
47
+ "RickyIG/emotion_face_image_classification",
48
+ "rizvandwiki/gender-classification",
49
+
50
+ "-- Food Classification --",
51
+ "nateraw/food",
52
+ "BinhQuocNguyen/food-recognition-model new",
53
+
54
+ "-- Medical/Dermatology --",
55
+ "google/derm-foundation new",
56
+ "google/cxr-foundation new",
57
+ "Anwarkh1/Skin_Cancer-Image_Classification new",
58
+
59
+ "-- AI vs Human Detection --",
60
+ "Ateeqq/ai-vs-human-image-detector new",
61
+ "umm-maybe/AI-image-detector new",
62
+
63
+ "-- Deepfake Detection --",
64
+ "not-lain/deepfake",
65
+
66
+ "-- Anime/Manga Classification --",
67
+ "Readidno/anime.mili new",
68
+
69
+ "-- Human Activity Recognition --",
70
+ "DunnBC22/vit-base-patch16-224-in21k_Human_Activity_Recognition",
71
+
72
+ "-- Clothing/Fashion --",
73
+ "aalonso-developer/vit-base-patch16-224-in21k-clothing-classifier",
74
+
75
+ "-- Real Estate --",
76
+ "andupets/real-estate-image-classification",
77
+
78
+ "-- Satellite/Remote Sensing --",
79
+ "FatihC/swin-tiny-patch4-window7-224-finetuned-eurosat-watermark",
80
+
81
+ "-- Car Classification --",
82
+ "lamnt2008/car_brands_classification new",
83
+
84
+ "-- Document Classification --",
85
+ "docling-project/DocumentFigureClassifier-v2.5 new",
86
+
87
+ "-- EfficientNet (timm) --",
88
+ "timm/efficientnet_b0.ra_in1k new",
89
+ "timm/mobilenetv3_large_100.ra_in1k",
90
+ "timm/mobilenetv3_small_100.lamb_in1k new",
91
+
92
+ "-- Experimental/Future --",
93
+ "#q-future/one-align",
94
  ]
95
 
96
  def classify(image, model):
97
+ model_name = model.replace(" new", "")
98
+ classifier = pipeline("image-classification", model=model_name)
99
  result= classifier(image)
100
  return result
101
 
contexto.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # Descrição
2
+
3
+ Esta aplicação é apenas uma demostração para o hugging face comparado varios classificadores de imagens