fixed aspect ratio to 16:9
Browse files- app.py +1 -1
- descriptions.py +13 -0
app.py
CHANGED
|
@@ -153,7 +153,7 @@ with (gr.Blocks(head=prefer_frontal_cam_html, css=css_image_aspect_ratio) as blo
|
|
| 153 |
b = gr.Button('PRESS TO PREDICT')
|
| 154 |
b.click(fn=predict_app, inputs=[im], outputs=gr.Info()) # add eater id to input if needed
|
| 155 |
|
| 156 |
-
|
| 157 |
|
| 158 |
with gr.Tab(label='ℹ️ Status', id=2):
|
| 159 |
gr.Markdown(' Press the button to see the status of the Application and technical information')
|
|
|
|
| 153 |
b = gr.Button('PRESS TO PREDICT')
|
| 154 |
b.click(fn=predict_app, inputs=[im], outputs=gr.Info()) # add eater id to input if needed
|
| 155 |
|
| 156 |
+
logout_button = gr.Button(link='/logout', value='Logout / Exit ↩', size='sm')
|
| 157 |
|
| 158 |
with gr.Tab(label='ℹ️ Status', id=2):
|
| 159 |
gr.Markdown(' Press the button to see the status of the Application and technical information')
|
descriptions.py
CHANGED
|
@@ -8,6 +8,19 @@ navigator.mediaDevices.getUserMedia = (constraints) => {
|
|
| 8 |
}
|
| 9 |
return originalGetUserMedia(constraints);
|
| 10 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
</script>
|
| 12 |
"""
|
| 13 |
|
|
|
|
| 8 |
}
|
| 9 |
return originalGetUserMedia(constraints);
|
| 10 |
};
|
| 11 |
+
|
| 12 |
+
function adjustHeight() {
|
| 13 |
+
var container = document.getElementById('image-container');
|
| 14 |
+
if (container) {
|
| 15 |
+
var width = container.offsetWidth;
|
| 16 |
+
var height = width * 9 / 16;
|
| 17 |
+
container.style.height = height + 'px';
|
| 18 |
+
}
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
window.addEventListener('resize', adjustHeight);
|
| 22 |
+
window.addEventListener('load', adjustHeight);
|
| 23 |
+
|
| 24 |
</script>
|
| 25 |
"""
|
| 26 |
|