Update the Frontend
Browse files- app.py +1 -1
- templates/index.html +45 -39
app.py
CHANGED
|
@@ -114,4 +114,4 @@ def index():
|
|
| 114 |
if __name__ == '__main__':
|
| 115 |
|
| 116 |
print("[INFO] Starting Flask server...")
|
| 117 |
-
app.run(debug=
|
|
|
|
| 114 |
if __name__ == '__main__':
|
| 115 |
|
| 116 |
print("[INFO] Starting Flask server...")
|
| 117 |
+
app.run(debug=True, host='0.0.0.0')
|
templates/index.html
CHANGED
|
@@ -11,53 +11,59 @@
|
|
| 11 |
|
| 12 |
<h1 class="text-4xl font-bold text-blue-400 mb-10">Virtual Fashion Try-On</h1>
|
| 13 |
|
| 14 |
-
<
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
|
|
|
| 41 |
</div>
|
| 42 |
-
</div>
|
| 43 |
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
|
| 51 |
-
|
| 52 |
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
<
|
| 56 |
-
|
| 57 |
-
<
|
|
|
|
|
|
|
| 58 |
</div>
|
|
|
|
|
|
|
| 59 |
</div>
|
| 60 |
-
{% endif %}
|
| 61 |
|
| 62 |
<script>
|
| 63 |
function showFileName(inputId, filenameId) {
|
|
|
|
| 11 |
|
| 12 |
<h1 class="text-4xl font-bold text-blue-400 mb-10">Virtual Fashion Try-On</h1>
|
| 13 |
|
| 14 |
+
<div class="flex flex-col md:flex-row gap-10 w-full max-w-6xl">
|
| 15 |
|
| 16 |
+
<!-- LEFT: Input Form -->
|
| 17 |
+
<form action="/" method="post" enctype="multipart/form-data" class="w-full md:w-1/2 bg-gray-800 rounded-2xl shadow-lg p-8 space-y-6">
|
| 18 |
+
|
| 19 |
+
<div class="grid grid-cols-1 gap-8">
|
| 20 |
+
<!-- Person Image Upload -->
|
| 21 |
+
<div>
|
| 22 |
+
<h2 class="text-lg font-semibold mb-2">Upload your photo</h2>
|
| 23 |
+
<label for="person_image" class="flex flex-col items-center justify-center border-2 border-dashed border-gray-600 rounded-xl p-6 hover:bg-gray-700 cursor-pointer">
|
| 24 |
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-10 w-10 text-gray-400 mb-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
| 25 |
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16v4m0 0h10m-10 0v-4m0 0h10m-10 0V5m0 0h10m-10 0H5m14 0h-2" />
|
| 26 |
+
</svg>
|
| 27 |
+
<p class="text-gray-400">Drag & drop or click to upload</p>
|
| 28 |
+
<input id="person_image" type="file" name="person_image" class="hidden" required onchange="showFileName('person_image', 'person_filename')">
|
| 29 |
+
</label>
|
| 30 |
+
<p id="person_filename" class="text-green-400 text-sm mt-2 text-center"></p>
|
| 31 |
+
</div>
|
| 32 |
|
| 33 |
+
<!-- T-Shirt Image Upload -->
|
| 34 |
+
<div>
|
| 35 |
+
<h2 class="text-lg font-semibold mb-2">Upload garment image</h2>
|
| 36 |
+
<label for="tshirt_image" class="flex flex-col items-center justify-center border-2 border-dashed border-gray-600 rounded-xl p-6 hover:bg-gray-700 cursor-pointer">
|
| 37 |
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-10 w-10 text-gray-400 mb-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
| 38 |
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16v4m0 0h10m-10 0v-4m0 0h10m-10 0V5m0 0h10m-10 0H5m14 0h-2" />
|
| 39 |
+
</svg>
|
| 40 |
+
<p class="text-gray-400">Drag & drop or click to upload</p>
|
| 41 |
+
<input id="tshirt_image" type="file" name="tshirt_image" class="hidden" required onchange="showFileName('tshirt_image', 'tshirt_filename')">
|
| 42 |
+
</label>
|
| 43 |
+
<p id="tshirt_filename" class="text-green-400 text-sm mt-2 text-center"></p>
|
| 44 |
+
</div>
|
| 45 |
</div>
|
|
|
|
| 46 |
|
| 47 |
+
<!-- Submit Button -->
|
| 48 |
+
<div class="flex justify-center">
|
| 49 |
+
<button type="submit" class="bg-pink-500 hover:bg-pink-600 text-white font-semibold py-3 px-8 rounded-xl shadow-md transition">
|
| 50 |
+
π Perform Virtual Try-On
|
| 51 |
+
</button>
|
| 52 |
+
</div>
|
| 53 |
|
| 54 |
+
</form>
|
| 55 |
|
| 56 |
+
<!-- RIGHT: Output -->
|
| 57 |
+
{% if result_img %}
|
| 58 |
+
<div class="w-full md:w-1/2 bg-gray-800 rounded-2xl shadow-lg p-8">
|
| 59 |
+
<h2 class="text-2xl font-bold mb-6 text-center">π Your Virtual Try-On Result</h2>
|
| 60 |
+
<div class="flex justify-center">
|
| 61 |
+
<img src="{{ result_img }}" alt="Result Image" class="rounded-xl">
|
| 62 |
+
</div>
|
| 63 |
</div>
|
| 64 |
+
{% endif %}
|
| 65 |
+
|
| 66 |
</div>
|
|
|
|
| 67 |
|
| 68 |
<script>
|
| 69 |
function showFileName(inputId, filenameId) {
|