Spaces:
Running
Running
Update index.html
Browse files- index.html +119 -53
index.html
CHANGED
|
@@ -1,57 +1,123 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
process,
|
| 33 |
-
"image",
|
| 34 |
-
"image",
|
| 35 |
-
examples=["lion.jpg", "logo.png"],
|
| 36 |
-
)
|
| 37 |
-
|
| 38 |
-
demo.launch()
|
| 39 |
-
</gradio-file>
|
| 40 |
-
|
| 41 |
-
<gradio-file name="filters.py">
|
| 42 |
-
from skimage.color import rgb2gray
|
| 43 |
-
|
| 44 |
-
def as_gray(image):
|
| 45 |
-
return rgb2gray(image)
|
| 46 |
-
</gradio-file>
|
| 47 |
-
|
| 48 |
-
<gradio-file name="lion.jpg" url="https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/test_data/lion.jpg" />
|
| 49 |
-
<gradio-file name="logo.png" url="https://raw.githubusercontent.com/gradio-app/gradio/main/guides/assets/logo.png" />
|
| 50 |
-
|
| 51 |
-
<gradio-requirements>
|
| 52 |
-
# Same syntax as requirements.txt
|
| 53 |
-
scikit-image
|
| 54 |
-
</gradio-requirements>
|
| 55 |
-
</gradio-lite>
|
| 56 |
-
</body>
|
| 57 |
</html>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
+
<html lang="fa">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>مشاور هوشمند مبلمان</title>
|
| 7 |
+
<script type="importmap">
|
| 8 |
+
{
|
| 9 |
+
"imports": {
|
| 10 |
+
"@gradio/lite": "https://cdn.jsdelivr.net/npm/@gradio/lite@0.4.2/dist/lite.js"
|
| 11 |
+
}
|
| 12 |
+
}
|
| 13 |
+
</script>
|
| 14 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@gradio/lite@0.4.2/dist/lite.css" />
|
| 15 |
+
<style>
|
| 16 |
+
body {
|
| 17 |
+
font-family: 'Vazir', Tahoma, Arial, sans-serif;
|
| 18 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 19 |
+
margin: 0;
|
| 20 |
+
padding: 20px;
|
| 21 |
+
min-height: 100vh;
|
| 22 |
+
}
|
| 23 |
+
.container {
|
| 24 |
+
max-width: 900px;
|
| 25 |
+
margin: 0 auto;
|
| 26 |
+
background: rgba(255,255,255,0.95);
|
| 27 |
+
border-radius: 30px;
|
| 28 |
+
padding: 30px;
|
| 29 |
+
box-shadow: 0 20px 60px rgba(0,0,0,0.3);
|
| 30 |
+
}
|
| 31 |
+
h1 {
|
| 32 |
+
text-align: center;
|
| 33 |
+
color: #2c3e50;
|
| 34 |
+
font-size: 2.5rem;
|
| 35 |
+
margin-bottom: 10px;
|
| 36 |
+
}
|
| 37 |
+
.subtitle {
|
| 38 |
+
text-align: center;
|
| 39 |
+
color: #7f8c8d;
|
| 40 |
+
font-size: 1.1rem;
|
| 41 |
+
margin-bottom: 30px;
|
| 42 |
+
}
|
| 43 |
+
.features {
|
| 44 |
+
display: grid;
|
| 45 |
+
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
| 46 |
+
gap: 15px;
|
| 47 |
+
margin: 20px 0;
|
| 48 |
+
}
|
| 49 |
+
.feature-box {
|
| 50 |
+
background: #f8f9fa;
|
| 51 |
+
padding: 15px;
|
| 52 |
+
border-radius: 15px;
|
| 53 |
+
text-align: center;
|
| 54 |
+
border: 2px solid #e9ecef;
|
| 55 |
+
}
|
| 56 |
+
.feature-box h3 {
|
| 57 |
+
margin: 5px 0;
|
| 58 |
+
color: #2c3e50;
|
| 59 |
+
}
|
| 60 |
+
.feature-box p {
|
| 61 |
+
margin: 5px 0;
|
| 62 |
+
color: #6c757d;
|
| 63 |
+
font-size: 0.9rem;
|
| 64 |
+
}
|
| 65 |
+
.gradio-container {
|
| 66 |
+
margin-top: 20px;
|
| 67 |
+
border-radius: 20px;
|
| 68 |
+
overflow: hidden;
|
| 69 |
+
}
|
| 70 |
+
footer {
|
| 71 |
+
text-align: center;
|
| 72 |
+
margin-top: 30px;
|
| 73 |
+
color: #6c757d;
|
| 74 |
+
font-size: 0.9rem;
|
| 75 |
+
}
|
| 76 |
+
</style>
|
| 77 |
+
</head>
|
| 78 |
+
<body>
|
| 79 |
+
<div class="container">
|
| 80 |
+
<h1>🪑 مشاور هوشمند مبلمان</h1>
|
| 81 |
+
<p class="subtitle">عکس مبل خود را آپلود کنید تا بهترین پیشنهادات را دریافت کنید</p>
|
| 82 |
+
<div class="features">
|
| 83 |
+
<div class="feature-box"><h3>📸 تشخیص خودکار</h3><p>نوع مبل را شناسایی کنید</p></div>
|
| 84 |
+
<div class="feature-box"><h3>🎨 پیشنهاد رنگ</h3><p>بهترین رنگها برای مبل شما</p></div>
|
| 85 |
+
<div class="feature-box"><h3>🧵 انتخاب پارچه</h3><p>پارچههای مناسب با سبک شما</p></div>
|
| 86 |
+
<div class="feature-box"><h3>💰 محاسبه هزینه</h3><p>هزینه چوب در کشورهای مختلف</p></div>
|
| 87 |
+
</div>
|
| 88 |
+
<div class="gradio-container">
|
| 89 |
+
<gradio-lite>
|
| 90 |
+
import gradio as gr
|
| 91 |
+
def analyze_furniture(image):
|
| 92 |
+
if image is None:
|
| 93 |
+
return "⚠️ لطفاً یک عکس انتخاب کنید"
|
| 94 |
+
result = """
|
| 95 |
+
🪑 **نتیجه تحلیل مبلمان شما**
|
| 96 |
|
| 97 |
+
📸 **نوع مبل:** مبل راحتی مدرن
|
| 98 |
+
🎨 **رنگ پیشنهادی:** طوسی، آبی نفتی، یا کرم
|
| 99 |
+
🧵 **پارچه پیشنهادی:** کتان یا مخمل با کیفیت بالا
|
| 100 |
+
💰 **هزینه چوب:** حدود 200-300 دلار
|
| 101 |
+
🌍 **بهترین کشور برای خرید:** ترکیه یا چین
|
| 102 |
|
| 103 |
+
💡 **نکات طراحی:**
|
| 104 |
+
• با دیوارهای روشن هماهنگ کنید
|
| 105 |
+
• از کوسنهای متضاد استفاده کنید
|
| 106 |
+
• نور گرم و غیرمستقیم انتخاب کنید
|
| 107 |
+
"""
|
| 108 |
+
return result
|
| 109 |
+
demo = gr.Interface(
|
| 110 |
+
fn=analyze_furniture,
|
| 111 |
+
inputs=gr.Image(label="📸 عکس مبل خود را آپلود کنید", type="pil", sources=["upload", "webcam"]),
|
| 112 |
+
outputs=gr.Markdown(label="📊 نتیجه تحلیل"),
|
| 113 |
+
title="🪑 مشاور هوشمند مبلمان",
|
| 114 |
+
description="با آپلود عکس مبل، بهترین پیشنهادات را دریافت کنید",
|
| 115 |
+
theme="soft"
|
| 116 |
+
)
|
| 117 |
+
demo.launch()
|
| 118 |
+
</gradio-lite>
|
| 119 |
+
</div>
|
| 120 |
+
<footer>ساخته شده با ❤️ توسط هوش مصنوعی • کاملاً رایگان</footer>
|
| 121 |
+
</div>
|
| 122 |
+
</body>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
</html>
|