Yunpeng-26 commited on
Commit
8d3f5ec
·
verified ·
1 Parent(s): 48e5c1b

Delete README.md

Browse files
Files changed (1) hide show
  1. README.md +0 -68
README.md DELETED
@@ -1,68 +0,0 @@
1
- ---
2
- title: AI-Powered Image Classification
3
- emoji: 🖼️
4
- colorFrom: blue
5
- colorTo: gray
6
- sdk: static
7
- app_file: index.html
8
- fullWidth: true
9
- short_description: Run ResNet, ViT and CLIP in your browser
10
- models:
11
- - Xenova/resnet-18
12
- - Xenova/vit-base-patch16-224
13
- - Xenova/clip-vit-base-patch32
14
- tags:
15
- - image-classification
16
- - education
17
- - transformers.js
18
- ---
19
-
20
- # AI-Powered Image Classification
21
-
22
- An English classroom demonstration with a pale background, blue accents and a clear sequence: choose an image, run a pretrained model, inspect evidence. No Python installation, model training or backend compute service is required to use this Space.
23
-
24
- ## Try it
25
-
26
- 1. Keep the cat sample and ResNet-18 selected, then click **Classify image**.
27
- 2. Wait for the real model download and browser inference. Progress is displayed. Cached files can be reused on later visits, subject to browser storage limits.
28
- 3. Compare ViT-B/16 on the same image.
29
- 4. Select CLIP and edit its candidate labels or prompt template.
30
- 5. Download JSON with settings and results, or a CSV prediction table.
31
-
32
- ## Models
33
-
34
- | Model | Browser checkpoint | Label space |
35
- |---|---|---|
36
- | ResNet-18 | [Xenova/resnet-18](https://huggingface.co/Xenova/resnet-18) | 1,000 ImageNet classes |
37
- | ViT-B/16 | [Xenova/vit-base-patch16-224](https://huggingface.co/Xenova/vit-base-patch16-224) | 1,000 ImageNet classes |
38
- | CLIP ViT-B/32 | [Xenova/clip-vit-base-patch32](https://huggingface.co/Xenova/clip-vit-base-patch32) | User-supplied candidate descriptions |
39
-
40
- The application uses Transformers.js 3.8.1 and quantized ONNX models (`q8`) on browser CPU through WebAssembly. A Web Worker keeps model computation separate from the interface. Only one selected model is kept in worker memory. Switching models releases the previous pipeline; downloaded files may remain in browser cache.
41
-
42
- These are browser-compatible checkpoints from the same model families used in the Python course. They are not guaranteed to match the Python TorchVision checkpoints numerically. Compare browser results within this demo and record the exact model ID included in the JSON export.
43
-
44
- ## Read scores carefully
45
-
46
- Top-k changes how many labels are displayed; it does not renormalize their scores. ResNet and ViT scores use the 1,000-class label space. CLIP scores are relative to the supplied candidates. Raw scores from different models are not accuracy comparisons.
47
-
48
- The review threshold flags the top score only. It does not filter predictions, update weights, calibrate confidence or reliably identify unknown images. Inference time covers preprocessing, model computation and postprocessing; it excludes model loading and interface time. Timings depend on the user's device.
49
-
50
- The four photographs form a small qualitative teaching set, not an accuracy benchmark. Classification describes the whole image and does not draw boxes or count objects.
51
-
52
- ## Data and images
53
-
54
- Inference happens in the browser. The application does not upload the selected image, candidate labels or predictions to an inference server. Models and runtime libraries download from Hugging Face and jsDelivr. Export files are generated locally. Images larger than 1,536 pixels on their longest side are resized for browser processing. Uploads are limited to 12 MB and 25 megapixels.
55
-
56
- Sample photographs come from the [scikit-image sample collection](https://scikit-image.org/docs/stable/api/skimage.data.html). Cat and coffee samples are CC0; astronaut and rocket samples are public domain. `sample-manifest.json` records source URLs, reuse status and hashes without personal names.
57
-
58
- ## Troubleshooting
59
-
60
- - On first use, leave the page open while the model downloads. Large models take longer than ResNet-18.
61
- - The network must allow Hugging Face model downloads and the pinned runtime on jsDelivr.
62
- - If a download or inference fails, retry or use the Cancel control, then start with ResNet-18.
63
- - Use a current desktop browser with WebAssembly and Web Worker support. Heavy models may exceed memory limits on some mobile devices.
64
- - For CLIP, use 2–50 unique short candidate labels. A confident prediction can still be wrong when the relevant concept is absent.
65
-
66
- ## Local preview
67
-
68
- Serve this folder using a local HTTP server, for example `python -m http.server 7862`, and open the localhost address. Opening `index.html` directly through `file://` does not provide a valid module-worker environment.