上一页 1 2 3 4 5 6 ··· 20 下一页
摘要: insightface 是一款优秀的开源人脸检测/识别库,下面将展示如何使用它 安装: pip install insightface -i https://mirror.baidu.com/pypi/simple 如需使用GPU资源(可选): pip install onnxruntime-gpu 阅读全文
posted @ 2022-01-12 15:47 牛郎 阅读(2643) 评论(0) 推荐(0) 编辑
摘要: 网上的大部教程都讲到了elasticsearch使用scroll游标的方法,但使用后往往没有清除游标,这会造成scroll超过最大数量的限制而报错,应该在任务结束时去手动清理scroll(否则只能等到设定的时间后游标才会自动清理) from elasticsearch import Elastics 阅读全文
posted @ 2021-10-28 15:03 牛郎 阅读(2330) 评论(0) 推荐(0) 编辑
摘要: 假设list是一个包含相同字段的字典的集合,目的要根据字段‘time’进行排序: 步骤一:将time字段对应的value转换成适合排序的int或float类型; 步骤二: from operator import itemgetter dst = sorted(list, key=itemgette 阅读全文
posted @ 2021-09-18 11:25 牛郎 阅读(149) 评论(0) 推荐(0) 编辑
摘要: master = true #启动主进程,来管理其他进程,其它的uwsgi进程都是这个master进程的子进程,如果kill这个master进程,相当于重启所有的uwsgi进程。 chdir = /web/www/mysite #在app加载前切换到当前目录, 指定运行目录 module = mys 阅读全文
posted @ 2021-08-26 09:28 牛郎 阅读(3271) 评论(0) 推荐(0) 编辑
摘要: import pymysql db = pymysql.connect(host='***.***.***.160', user='root', passwd='Ca8th**#Python', db='fusion_media', charset='utf8mb4', port=3306) cur 阅读全文
posted @ 2021-08-11 15:42 牛郎 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 基础篇: import dlib import cv2 import numpy as np def main(img_path='./1.jpg'): detector = dlib.get_frontal_face_detector() # 人脸box检测器 image = cv2.imread 阅读全文
posted @ 2021-08-09 11:19 牛郎 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 该方法通过基于 cv2.VideoCapture 能够获取视频流入(rtmp/rtsp等)实时帧,能够解决由于图像处理速度不够等原因造成帧堆积的问题。 import cv2 from threading import Thread class ThreadedCamera(object): def 阅读全文
posted @ 2021-08-02 09:29 牛郎 阅读(2985) 评论(0) 推荐(0) 编辑
摘要: 1. 安装supervisor supervisor可以帮助我们盯着python程序,哪怕是python程序不小心挂掉了,supervisor也会帮我们立即启起来,首先开始安装 pip install supervisor -i https://pypi.tuna.tsinghua.edu.cn/s 阅读全文
posted @ 2021-07-09 15:44 牛郎 阅读(744) 评论(0) 推荐(0) 编辑
摘要: 基于dlib识别人脸68个关键点: predictor = dlib.shape_predictor('res/model.dat') predictor(gray, det) 使用cnn提取特征时,偶尔会报错: 1. (self: _dlib_pybind11.shape_predictor, i 阅读全文
posted @ 2021-07-05 17:44 牛郎 阅读(858) 评论(0) 推荐(0) 编辑
摘要: # 下载和保存图像 import requests video_url = '*****' response = requests.get(url=video_url) # 下载视频到本地1.mp4 video_bytes = response.content temp_video_path = ' 阅读全文
posted @ 2021-07-01 15:41 牛郎 阅读(408) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 20 下一页