Create cv.py
Browse files
cv.py
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
import streamlit as st
|
| 3 |
+
import streamlit.components.v1 as components
|
| 4 |
+
import streamlit_text_annotation as st_text_annotation
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
with open('style.css') as f:
|
| 8 |
+
st.markdown(f'<style>{f.read()}</style>', unsafe_allow_html=True)
|
| 9 |
+
|
| 10 |
+
htm_string = '''
|
| 11 |
+
<head>
|
| 12 |
+
<meta charset="utf-8">
|
| 13 |
+
</head>
|
| 14 |
+
<body style="height: 100%; margin: 0">
|
| 15 |
+
<div id="container" style="height: 100%"></div>
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
<script type="text/javascript" src="https://fastly.jsdelivr.net/npm/echarts@5.4.2/dist/echarts.min.js"></script>
|
| 19 |
+
<!-- Uncomment this line if you want to dataTool extension
|
| 20 |
+
<script type="text/javascript" src="https://fastly.jsdelivr.net/npm/echarts@5.4.2/dist/extension/dataTool.min.js"></script>
|
| 21 |
+
-->
|
| 22 |
+
<!-- Uncomment this line if you want to use gl extension
|
| 23 |
+
<script type="text/javascript" src="https://fastly.jsdelivr.net/npm/echarts-gl@2/dist/echarts-gl.min.js"></script>
|
| 24 |
+
-->
|
| 25 |
+
<!-- Uncomment this line if you want to echarts-stat extension
|
| 26 |
+
<script type="text/javascript" src="https://fastly.jsdelivr.net/npm/echarts-stat@latest/dist/ecStat.min.js"></script>
|
| 27 |
+
-->
|
| 28 |
+
<!-- Uncomment this line if you want to use map
|
| 29 |
+
<script type="text/javascript" src="https://fastly.jsdelivr.net/npm/echarts@4.9.0/map/js/china.js"></script>
|
| 30 |
+
<script type="text/javascript" src="https://fastly.jsdelivr.net/npm/echarts@4.9.0/map/js/world.js"></script>
|
| 31 |
+
-->
|
| 32 |
+
<!-- Uncomment these two lines if you want to use bmap extension
|
| 33 |
+
<script type="text/javascript" src="https://api.map.baidu.com/api?v=3.0&ak=YOUR_API_KEY"></script>
|
| 34 |
+
<script type="text/javascript" src="https://fastly.jsdelivr.net/npm/echarts@5.4.2/dist/extension/bmap.min.js"></script>
|
| 35 |
+
-->
|
| 36 |
+
|
| 37 |
+
<script type="text/javascript">
|
| 38 |
+
var dom = document.getElementById('container');
|
| 39 |
+
var myChart = echarts.init(dom, null, {
|
| 40 |
+
renderer: 'canvas',
|
| 41 |
+
useDirtyRect: false
|
| 42 |
+
});
|
| 43 |
+
var app = {};
|
| 44 |
+
|
| 45 |
+
var option;
|
| 46 |
+
|
| 47 |
+
option = {
|
| 48 |
+
graphic: {
|
| 49 |
+
elements: [
|
| 50 |
+
{
|
| 51 |
+
type: 'text',
|
| 52 |
+
left: 'center',
|
| 53 |
+
top: 'center',
|
| 54 |
+
style: {
|
| 55 |
+
text: 'صحت',
|
| 56 |
+
fontSize: 80,
|
| 57 |
+
fontWeight: 'bold',
|
| 58 |
+
lineDash: [0, 200],
|
| 59 |
+
lineDashOffset: 0,
|
| 60 |
+
fill: 'transparent',
|
| 61 |
+
stroke: '#327fa8',
|
| 62 |
+
lineWidth: 1
|
| 63 |
+
},
|
| 64 |
+
keyframeAnimation: {
|
| 65 |
+
duration: 4000,
|
| 66 |
+
loop: true,
|
| 67 |
+
keyframes: [
|
| 68 |
+
{
|
| 69 |
+
percent: 0.7,
|
| 70 |
+
style: {
|
| 71 |
+
fill: 'transparent',
|
| 72 |
+
lineDashOffset: 200,
|
| 73 |
+
lineDash: [200, 0]
|
| 74 |
+
}
|
| 75 |
+
},
|
| 76 |
+
{
|
| 77 |
+
// Stop for a while.
|
| 78 |
+
percent: .7,
|
| 79 |
+
style: {
|
| 80 |
+
fill: 'transparent'
|
| 81 |
+
}
|
| 82 |
+
},
|
| 83 |
+
{
|
| 84 |
+
percent: 1,
|
| 85 |
+
style: {
|
| 86 |
+
fill: '#66ccff'
|
| 87 |
+
}
|
| 88 |
+
}
|
| 89 |
+
]
|
| 90 |
+
}
|
| 91 |
+
}
|
| 92 |
+
]
|
| 93 |
+
}
|
| 94 |
+
};
|
| 95 |
+
|
| 96 |
+
if (option && typeof option === 'object') {
|
| 97 |
+
myChart.setOption(option);
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
window.addEventListener('resize', myChart.resize);
|
| 101 |
+
</script>
|
| 102 |
+
</body>
|
| 103 |
+
'''
|
| 104 |
+
|
| 105 |
+
components.html(htm_string) # JavaScript works
|
| 106 |
+
|
| 107 |
+
st.title('اپلیکیشن کمکیار ورزشی')
|
| 108 |
+
|
| 109 |
+
|
| 110 |
+
recorded_file = 'pages/lt.mov'
|
| 111 |
+
sample_vid = st.empty()
|
| 112 |
+
sample_vid.video(recorded_file)
|
| 113 |
+
st.write("ستایش سلطانی نگین نظری")
|