AurevinP commited on
Commit
3425796
Β·
verified Β·
1 Parent(s): d13d7e1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +159 -149
README.md CHANGED
@@ -1,149 +1,159 @@
1
- # Structura AI: Depth & Structural Masking Web Application
2
-
3
- Structura AI is a web-based image analysis tool that generates a structural mask by combining monocular depth estimation and texture-based feature detection.
4
- The system integrates MiDaS (DPT-Hybrid) for depth prediction with OpenCV-based edge, corner, and texture fusion to produce a detailed, high-frequency structural representation of any input image.
5
-
6
- This mask is useful for segmentation workflows, diffusion model conditioning, preprocessing for generative AI, architectural analysis, and general computer vision pipelines.
7
-
8
- ---
9
-
10
- ## Features
11
-
12
- * MiDaS Depth Estimation: High-quality depth prediction using the DPT-Hybrid model.
13
- * Combined Structural Masking: Fusion of depth gradients, edges (Canny), Laplacian detail, and Harris corner responses.
14
- * FastAPI Backend: Clean API endpoint (`POST /mask/`) returning PNG masks with inference time metadata.
15
- * Web UI: A simple and modern interface built with HTML, CSS, and JavaScript allowing image upload, preview, overlay visualization, and mask download.
16
- * Docker Support: Fully dockerized and ready for deployment on services such as Hugging Face Spaces.
17
-
18
- ---
19
-
20
- ## Demo
21
-
22
- This section is reserved for demo images and demo videos.
23
- Add examples such as:
24
-
25
- * Original input image
26
- * Generated structural mask
27
- * Overlay visualization
28
- * A short screen recording demonstrating the UI
29
-
30
- ---
31
-
32
- ## Technology Stack
33
-
34
- Backend: FastAPI, Uvicorn
35
- AI / Computer Vision: PyTorch, MiDaS, OpenCV (headless), NumPy
36
- Frontend: HTML, CSS, JavaScript
37
- Deployment: Docker, Hugging Face Spaces
38
-
39
- ---
40
-
41
- ## Repository Structure
42
-
43
- ```
44
- structura-ai/
45
- β”œβ”€β”€ app.py
46
- β”œβ”€β”€ depth_texture_mask.py
47
- β”œβ”€β”€ requirements.txt
48
- β”œβ”€β”€ Dockerfile
49
- β”œβ”€β”€ templates/
50
- β”‚ └── index.html
51
- └── static/
52
- β”œβ”€β”€ styles.css
53
- β”œβ”€β”€ app.js
54
- └── logo.svg
55
- ```
56
-
57
- ---
58
-
59
- ## Local Installation and Usage
60
-
61
- ### 1. Clone the Repository
62
-
63
- ```
64
- git clone https://github.com/PritamTheCoder/midas-depth-texture-mask-api.git
65
- cd midas-depth-texture-mask-api
66
- ```
67
-
68
- ### 2. Create and Activate a Virtual Environment
69
-
70
- ```
71
- python -m venv venv
72
-
73
- # Windows
74
- venv\Scripts\activate
75
-
76
- # macOS / Linux
77
- source venv/bin/activate
78
- ```
79
-
80
- ### 3. Install Dependencies
81
-
82
- ```
83
- pip install -r requirements.txt
84
- ```
85
-
86
- ### 4. Start the Application
87
-
88
- ```
89
- uvicorn app:app --reload --host 0.0.0.0 --port 8000
90
- ```
91
-
92
- ### 5. Access the Web UI
93
-
94
- Open the browser and navigate to:
95
- [http://127.0.0.1:8000/](http://127.0.0.1:8000/)
96
-
97
- The MiDaS model weights will automatically download on the first startup.
98
-
99
- ---
100
-
101
- ## Deployment on Hugging Face Spaces (Docker)
102
-
103
- The project includes a Dockerfile configured for seamless deployment on Hugging Face Spaces.
104
-
105
- ### Required File Structure
106
-
107
- Ensure the following files are present at the repository root:
108
-
109
- ```
110
- Dockerfile
111
- app.py
112
- depth_texture_mask.py
113
- requirements.txt
114
- templates/
115
- static/
116
- ```
117
-
118
- ### Deployment Steps
119
-
120
- 1. Create a new Hugging Face Space.
121
- 2. Select "Docker" as the runtime.
122
- 3. Upload or commit all repository files.
123
- 4. Hugging Face will automatically:
124
-
125
- * Build the Docker image
126
- * Install dependencies
127
- * Expose the correct port
128
- * Start the FastAPI server
129
-
130
- The application will then be available as a hosted interactive web demo.
131
-
132
- ---
133
-
134
- ## License
135
-
136
- This project is licensed under the MIT License.
137
- See the LICENSE file for details.
138
-
139
- ---
140
-
141
- ## Acknowledgements
142
-
143
- MiDaS by Intel-ISL
144
- FastAPI for backend framework
145
- OpenCV for feature detection and image processing
146
- PyTorch for deep learning inference support
147
- Hugging Face for deployment infrastructure
148
-
149
- ---
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ title: 'Structura AI: Depth & Structural Masking'
4
+ sdk: docker
5
+ emoji: πŸš€
6
+ colorFrom: indigo
7
+ colorTo: blue
8
+ pinned: true
9
+ app_port: 8000
10
+ ---
11
+
12
+ # Structura AI: Depth & Structural Masking Web Application
13
+
14
+ Structura AI is a web-based image analysis tool that generates a structural mask by combining monocular depth estimation and texture-based feature detection.
15
+ The system integrates MiDaS (DPT-Hybrid) for depth prediction with OpenCV-based edge, corner, and texture fusion to produce a detailed, high-frequency structural representation of any input image.
16
+
17
+ This mask is useful for segmentation workflows, diffusion model conditioning, preprocessing for generative AI, architectural analysis, and general computer vision pipelines.
18
+
19
+ ---
20
+
21
+ ## Features
22
+
23
+ * MiDaS Depth Estimation: High-quality depth prediction using the DPT-Hybrid model.
24
+ * Combined Structural Masking: Fusion of depth gradients, edges (Canny), Laplacian detail, and Harris corner responses.
25
+ * FastAPI Backend: Clean API endpoint (`POST /mask/`) returning PNG masks with inference time metadata.
26
+ * Web UI: A simple and modern interface built with HTML, CSS, and JavaScript allowing image upload, preview, overlay visualization, and mask download.
27
+ * Docker Support: Fully dockerized and ready for deployment on services such as Hugging Face Spaces.
28
+
29
+ ---
30
+
31
+ ## Demo
32
+
33
+ This section is reserved for demo images and demo videos.
34
+ Add examples such as:
35
+
36
+ * Original input image
37
+ * Generated structural mask
38
+ * Overlay visualization
39
+ * A short screen recording demonstrating the UI
40
+
41
+ ---
42
+
43
+ ## Technology Stack
44
+
45
+ Backend: FastAPI, Uvicorn
46
+ AI / Computer Vision: PyTorch, MiDaS, OpenCV (headless), NumPy
47
+ Frontend: HTML, CSS, JavaScript
48
+ Deployment: Docker, Hugging Face Spaces
49
+
50
+ ---
51
+
52
+ ## Repository Structure
53
+
54
+ ```
55
+ structura-ai/
56
+ β”œβ”€β”€ app.py
57
+ β”œβ”€β”€ depth_texture_mask.py
58
+ β”œβ”€β”€ requirements.txt
59
+ β”œβ”€β”€ Dockerfile
60
+ β”œβ”€β”€ templates/
61
+ β”‚ └── index.html
62
+ └── static/
63
+ β”œβ”€β”€ styles.css
64
+ └── app.js
65
+ ```
66
+
67
+ ---
68
+
69
+ ## Local Installation and Usage
70
+
71
+ ### 1. Clone the Repository
72
+
73
+ ```
74
+ git clone https://github.com/PritamTheCoder/midas-depth-texture-mask-api.git
75
+ cd midas-depth-texture-mask-api
76
+ ```
77
+
78
+ ### 2. Create and Activate a Virtual Environment
79
+
80
+ ```
81
+ python -m venv venv
82
+
83
+ # Windows
84
+ venv\Scripts\activate
85
+
86
+ # macOS / Linux
87
+ source venv/bin/activate
88
+ ```
89
+
90
+ ### 3. Install Dependencies
91
+
92
+ ```
93
+ pip install -r requirements.txt
94
+ ```
95
+
96
+ ### 4. Start the Application
97
+
98
+ ```
99
+ uvicorn app:app --reload --host 0.0.0.0 --port 8000
100
+ ```
101
+
102
+ ### 5. Access the Web UI
103
+
104
+ Open the browser and navigate to:
105
+ [http://127.0.0.1:8000/](http://127.0.0.1:8000/)
106
+
107
+ The MiDaS model weights will automatically download on the first startup.
108
+
109
+ ---
110
+
111
+ ## Deployment on Hugging Face Spaces (Docker)
112
+
113
+ The project includes a Dockerfile configured for seamless deployment on Hugging Face Spaces.
114
+
115
+ ### Required File Structure
116
+
117
+ Ensure the following files are present at the repository root:
118
+
119
+ ```
120
+ Dockerfile
121
+ app.py
122
+ depth_texture_mask.py
123
+ requirements.txt
124
+ templates/
125
+ static/
126
+ ```
127
+
128
+ ### Deployment Steps
129
+
130
+ 1. Create a new Hugging Face Space.
131
+ 2. Select "Docker" as the runtime.
132
+ 3. Upload or commit all repository files.
133
+ 4. Hugging Face will automatically:
134
+
135
+ * Build the Docker image
136
+ * Install dependencies
137
+ * Expose the correct port
138
+ * Start the FastAPI server
139
+
140
+ The application will then be available as a hosted interactive web demo.
141
+
142
+ ---
143
+
144
+ ## License
145
+
146
+ This project is licensed under the MIT License.
147
+ See the LICENSE file for details.
148
+
149
+ ---
150
+
151
+ ## Acknowledgements
152
+
153
+ MiDaS by Intel-ISL
154
+ FastAPI for backend framework
155
+ OpenCV for feature detection and image processing
156
+ PyTorch for deep learning inference support
157
+ Hugging Face for deployment infrastructure
158
+
159
+ ---