Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -101,7 +101,46 @@ def predict(image):
|
|
101 |
inputs = gr.inputs.Image(type="pil")
|
102 |
outputs = gr.outputs.JSON()
|
103 |
|
104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
|
106 |
-
|
107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
inputs = gr.inputs.Image(type="pil")
|
102 |
outputs = gr.outputs.JSON()
|
103 |
|
104 |
+
# Define the HTML template with the copyright text
|
105 |
+
html_template = """
|
106 |
+
<!DOCTYPE html>
|
107 |
+
<html>
|
108 |
+
<head>
|
109 |
+
<title>Naked Detector</title>
|
110 |
+
<style>
|
111 |
+
/* Your CSS styles here */
|
112 |
+
.footer {
|
113 |
+
position: fixed;
|
114 |
+
left: 0;
|
115 |
+
bottom: 0;
|
116 |
+
width: 100%;
|
117 |
+
background-color: #f5f5f5;
|
118 |
+
text-align: center;
|
119 |
+
padding: 10px;
|
120 |
+
}
|
121 |
+
</style>
|
122 |
+
</head>
|
123 |
+
<body>
|
124 |
+
<!-- Gradio interface placeholder -->
|
125 |
+
<div id="interface"></div>
|
126 |
|
127 |
+
<!-- Footer -->
|
128 |
+
<div class="footer">
|
129 |
+
<p>© 2023 KUO SUKO. All rights reserved.</p>
|
130 |
+
<p> C110156115 From NKUST </p>
|
131 |
+
</div>
|
132 |
+
|
133 |
+
<!-- Gradio script -->
|
134 |
+
<script src="https://cdn.jsdelivr.net/npm/gradio"></script>
|
135 |
+
<script>
|
136 |
+
// Gradio code here
|
137 |
+
const iface = gr.Interface(fn, inputs, outputs);
|
138 |
+
iface.launch({ target: '#interface' });
|
139 |
+
</script>
|
140 |
+
</body>
|
141 |
+
</html>
|
142 |
+
"""
|
143 |
+
|
144 |
+
# Create a Gradio interface with the HTML template
|
145 |
+
interface = gr.Interface(predict, inputs, outputs, title="Naked Detector", webapp=True, allow_screenshot=False, allow_flagging=False, template=html_template)
|
146 |
+
interface.launch()
|