Brightsun10 commited on
Commit
cdd7eee
·
verified ·
1 Parent(s): 1b1e5a0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +59 -5
README.md CHANGED
@@ -1,8 +1,62 @@
1
- title: Advanced Instance Segmentation
2
- emoji: 🖼️✨
3
- colorFrom: blue
4
- colorTo: green
 
5
  sdk: gradio
 
6
  app_file: app.py
7
  pinned: false
8
- Advanced Instance Segmentation with Mask2FormerThis Hugging Face Space provides an interactive demo for Instance Segmentation, a computer vision task that locates and delineates each distinct object of interest in an image.This application uses the powerful Mask2Former model (facebook/mask2former-swin-large-coco-instance), a state-of-the-art architecture for panoptic, instance, and semantic segmentation.How to UseUpload an image using the panel on the left. You can also drag and drop a file.If you don't have an image, simply click one of the example images provided below the upload box.The model will process the image and display the output on the right. Each detected object will have:A colored mask overlay.A bounding box.A label with its confidence score.Target ClassesThe model is configured to specifically detect the following classes:Vehicles: car, truck, busPeople: personAnimals: cat, dogLimitationsBuilding Detection: The COCO dataset, on which this model was trained, does not have a generic "building" class. Therefore, buildings will not be segmented. To detect buildings, the model would need to be fine-tuned on a dataset that includes them (e.g., ADE20K).Performance: This is a large model. Processing on free CPU hardware can take 20-40 seconds. For real-time performance, upgrading the Space to GPU hardware is recommended.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Instance Segmentation Demo
3
+ emoji: 🖼️
4
+ colorFrom: pink
5
+ colorTo: purple
6
  sdk: gradio
7
+ sdk_version: "4.24.0"
8
  app_file: app.py
9
  pinned: false
10
+ ---
11
+
12
+ # 🖼️ Instance Segmentation with Mask2Former
13
+
14
+ This demo performs **advanced instance segmentation** using [Mask2Former](https://huggingface.co/facebook/mask2former-swin-large-coco-instance) from Facebook AI. It identifies and highlights individual objects in an image with:
15
+ - **Colored masks**
16
+ - **Bounding boxes**
17
+ - **Class labels and confidence scores**
18
+
19
+ ## 🚀 How It Works
20
+
21
+ - Input an image via upload or example selection.
22
+ - The app uses the `facebook/mask2former-swin-large-coco-instance` model to detect objects.
23
+ - Only the following classes are visualized:
24
+ - `cat`, `dog`, `car`, `truck`, `bus`, `person`
25
+ - Results are drawn on the image and displayed along with a status message.
26
+
27
+ ## 🧠 Model
28
+
29
+ - **Architecture:** Mask2Former with Swin-Large backbone
30
+ - **Dataset:** COCO Instance
31
+ - **Framework:** Hugging Face Transformers + PyTorch
32
+
33
+ ## 💻 Technologies Used
34
+
35
+ - Python 🐍
36
+ - [Gradio](https://gradio.app) for UI
37
+ - Hugging Face Transformers
38
+ - PIL & NumPy for image manipulation
39
+
40
+ ## 📷 Example Images
41
+
42
+ Try out with example images like:
43
+ - Cats vs. Dogs
44
+ - Street scenes with vehicles and people
45
+
46
+ You can also upload your own images!
47
+
48
+ ## 📌 Notes
49
+
50
+ - Detection is limited to high-confidence predictions (`score > 0.9`)
51
+ - This demo is optimized for CPU; inference may take up to 30 seconds.
52
+
53
+ ---
54
+
55
+ ## 🛠️ Developer Notes
56
+
57
+ This app uses the following Gradio configuration:
58
+
59
+ ```yaml
60
+ sdk: gradio
61
+ sdk_version: "4.24.0"
62
+ app_file: app.py