当前位置: 首页 > news >正文

浙江杰立建设集团网站什么网站可以接单做海报

浙江杰立建设集团网站,什么网站可以接单做海报,大型销售网站建设,51个人网站怎么打开用streamlit实现云台控制界面 效果图PC上的效果手机上的效果 源码: 本文演示了,如何用streamlit做一个云台控制界面。功能包括:用户登录,事件的处理,图片的更新 版本信息: streamlit_authenticator: 下载链接streamlit : 1.31.1python: 3.11 修改点: streamlit_authenticato… 用streamlit实现云台控制界面 效果图PC上的效果手机上的效果 源码: 本文演示了,如何用streamlit做一个云台控制界面。功能包括:用户登录,事件的处理,图片的更新 版本信息: streamlit_authenticator: 下载链接streamlit : 1.31.1python: 3.11 修改点: streamlit_authenticator 从bcrypt.hashpw改成hashlib.sha256(以提升速度) 效果图 PC上的效果 手机上的效果 源码: import streamlit as st #1.31.1 import cv2 import numpy as np import datetime import glob import os import sys sys.path.append(.) import streamlit_authenticator as stauth import yaml from yaml.loader import SafeLoaderdef get_image(kwargs):生成图片,删除旧图片print(kwargs)imagenp.ones((240,320,3),dtypenp.uint8)*128current_time datetime.datetime.now()date_format %Y%m%d%H%M%Stime_string current_time.strftime(date_format)for name in glob.glob(img_cache/*.png):date_object datetime.datetime.strptime(os.path.basename(name).split(.)[0], date_format)if (current_time-date_object).total_seconds()60:os.remove(name)font cv2.FONT_HERSHEY_SIMPLEX label[time_string]for k,v in kwargs.items():if v:label.append(k)cv2.putText(image, -.join(label), (1, 32), font, 0.6, (255, 255, 255),1, cv2.LINE_AA)ok, img cv2.imencode(.png, image, [cv2.IMWRITE_JPEG_QUALITY,20])filenameimg_cache/{}.png.format(time_string)with open(filename,wb) as f:f.write(img.tobytes())return filenamedef mainContent(): 主界面# 初始化状态if last_image not in st.session_state:st.session_state[last_image] None# UI布局with st.container(borderTrue): st.write(云台控制)col1, col2,col3,col4 st.columns([0.3,0.3,0.3,0.3])with col1:st.button(:arrow_up:,use_container_widthTrue,kwargs{type:up},keyup_btn)with col2:st.button(:arrow_down:,use_container_widthTrue,kwargs{type:down},keydown_btn) with col3:st.button(:arrow_left:,use_container_widthTrue,kwargs{type:left},keyleft_btn) with col4: st.button(:arrow_right:,use_container_widthTrue,kwargs{type:right},keyright_btn) with st.container(borderTrue):st.write(预置点控制)preset st.slider(预置点, 1, 10, 1)st.button(跳转到预置点,use_container_widthFalse,kwargs{type:down},keygoto_btn) with st.container(borderTrue):st.write(预览)placeholder st.empty()# 事件处理逻辑if st.session_state.up_btn or st.session_state.down_btn:with placeholder.container():st.session_state[last_image]get_image({up_btn:st.session_state.up_btn,down_btn:st.session_state.down_btn})if st.session_state.left_btn or st.session_state.right_btn:with placeholder.container():st.session_state[last_image]get_image({left_btn:st.session_state.left_btn,right_btn:st.session_state.right_btn})if st.session_state.goto_btn:with placeholder.container():st.session_state[last_image]get_image({goto_btn:st.session_state.goto_btn,preset:preset})if st.session_state[last_image]:st.image(st.session_state[last_image])if __name__ __main__:# 设置标题,图标等st.set_page_config(layoutcentered,page_title云台控制,page_icon:shark:)# 设置自定义样式button_styles {width: 54px,-webkit-box-align: center,align-items: center,-webkit-box-pack: center,justify-content: center, display: flex,padding: 10px}st.write(stylediv.row-widget.stButton{ %s }/style % button_styles, unsafe_allow_htmlTrue)st.markdown(stylesection.css-vk3wp9.eczjsme11{display: none;}/style, unsafe_allow_htmlTrue)# 鉴权with open(config.yaml) as file:config yaml.load(file, LoaderSafeLoader)authenticator stauth.Authenticate(config[credentials],config[cookie][name],config[cookie][key],config[cookie][expiry_days],config[preauthorized]) authenticator.login()if st.session_state[authentication_status]:authenticator.logout()mainContent()elif st.session_state[authentication_status] is False:st.error(用户名或密码错误)elif st.session_state[authentication_status] is None:st.warning(请输入用户名和密码)
http://www.zqtcl.cn/news/842721/

相关文章:

  • 佛山优化网站公司做购物网站需要多少钱
  • 山东网站建设维护营销型网站是什么样的
  • 长沙营销网站建设苏州风险区域最新
  • 个人网站百度推广收费wordpress发邮件慢
  • 三门峡网站设计wordpress 去掉功能
  • 网站小程序开发公司wordpress 用户授权
  • 做外贸的几个网站响应式网站wordpress摄影
  • 专业建设网站技术wordpress 虚拟资源
  • 广告网站设计哪家快网站建设外包包含内容
  • 网页游戏网站模板张家口住房和城乡建设部网站
  • 冀州建设局网站公司制作网站多少钱
  • 建设个招聘网站黄页88和58那个推广好
  • 如何设计一个漂亮的网站电商设计素材
  • 沈阳建设银行网站首页果冻影视传媒有限公司
  • 建设部网站有建筑施工分包网站规划设计方案
  • 网站wap怎么做郑州做网站华久科技
  • 哪里网站开发好姜堰网站定制
  • 广东网站开发需要多少钱百度问答官网
  • 建设电影网站的关键wordpress简码怎么用
  • 做网站的linux程序代码北京公司减资流程
  • 四川省住房建设厅网站进不去wordpress 无限下拉菜单
  • 培训网站图片网络编程基础知识
  • 外销网站怎么做的上海住房与城乡建设部网站
  • 平台网站建设教程网站建设谈业务要知道什么
  • php网站开发试题济南网站排名公司
  • 没有官方网站怎么做seo优化营销推广平台都干什么的
  • 网盘搜索网站怎么做中国建设银行网站股份结构变化
  • 有ip怎么用自己的主机做网站惠州网站制作维护
  • 优质的网站制作在线编辑器
  • 盘锦做网站电话网络营销做私活网站