Charlie81 commited on
Commit
b694045
·
verified ·
1 Parent(s): bb6e931

Update model card

Browse files
Files changed (1) hide show
  1. README.md +11 -42
README.md CHANGED
@@ -5,57 +5,26 @@ tags:
5
  - vision-transformer
6
  - civitai
7
  - vit5
 
 
8
  ---
9
 
10
  # GenGlasses — CivitAI Model Reverse Engineer
11
 
12
- Predicts the **Stable Diffusion model**, **model family**, and **tags**
13
- from a generated image, using a fine-tuned [ViT-5](https://arxiv.org/abs/2602.08071) backbone.
14
 
15
  ## Label Space
16
- - **Models** : 50 (top-50 CivitAI checkpoints by downloads)
17
  - **Families**: 8 — `Flux, Illustrious, NoobAI, Other, Pony, SD 1.5, SDXL, ZImageTurbo`
18
  - **Tags** : 108
19
 
20
- ## Architecture
21
- - Backbone : `vit5_base` (pretrained weights from FengWang3211/ViT-5)
22
- - 3 output heads: `head_model` (CE), `head_family` (CE), `head_tags` (BCE multi-label)
23
-
24
  ## Training History
25
- | Run | Date | New Images | Best Val Loss |
26
- |-----|------|-----------|---------------|
27
- | 1 | 2026-04-04 | 834 | 2.3399 |
28
-
29
-
30
- ## Usage
31
- ```python
32
- import torch, json
33
- from huggingface_hub import hf_hub_download
34
- from PIL import Image
35
- from torchvision import transforms
36
-
37
- ckpt_path = hf_hub_download('Charlie81/genglasses', 'best.pth')
38
- maps_path = hf_hub_download('Charlie81/genglasses', 'label_maps.json')
39
-
40
- with open(maps_path) as f:
41
- label_maps = json.load(f)
42
-
43
- ckpt = torch.load(ckpt_path, map_location='cpu')
44
- # Re-build model (see training notebook) then:
45
- model.load_state_dict(ckpt['model'])
46
- model.eval()
47
-
48
- img = Image.open('your_image.jpg').convert('RGB')
49
- tf = transforms.Compose([
50
- transforms.Resize(256), transforms.CenterCrop(224),
51
- transforms.ToTensor(),
52
- transforms.Normalize([0.485,0.456,0.406],[0.229,0.224,0.225]),
53
- ])
54
- with torch.no_grad():
55
- out_model, out_family, out_tags = model(tf(img).unsqueeze(0))
56
 
57
- pred_model = label_maps['model_names'][out_model.argmax().item()]
58
- pred_family = label_maps['model_families'][out_family.argmax().item()]
59
- pred_tags = [label_maps['all_tags'][i] for i, v in enumerate(out_tags.sigmoid()[0]) if v > 0.5]
60
- print(pred_model, pred_family, pred_tags)
61
  ```
 
5
  - vision-transformer
6
  - civitai
7
  - vit5
8
+ - runpod
9
+ pipeline_tag: image-classification
10
  ---
11
 
12
  # GenGlasses — CivitAI Model Reverse Engineer
13
 
14
+ Predicts **SD checkpoint**, **model family**, and **tags** from a generated image.
15
+ Served via RunPod serverless: [cjyu81/genglassrunpod](https://github.com/cjyu81/genglassrunpod)
16
 
17
  ## Label Space
18
+ - **Models** : 50
19
  - **Families**: 8 — `Flux, Illustrious, NoobAI, Other, Pony, SD 1.5, SDXL, ZImageTurbo`
20
  - **Tags** : 108
21
 
 
 
 
 
22
  ## Training History
23
+ | Run | Date | Skip Scrape | Fresh Train | New Images | Best Val Loss |
24
+ |-----|------|------------|-------------|-----------|---------------|
25
+ | 1 | 2026-04-04 | True | True | 831 | 2.3535 |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
 
27
+ ## RunPod Request
28
+ ```json
29
+ {"input": {"image": "<base64-jpeg>"}}
 
30
  ```