首页 > 其他分享 >face_masker

face_masker

时间:2022-09-29 11:34:56浏览次数:35  
标签:masker python frame cap ret face install cv

安装opencv

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python

测试代码

import numpy as np
import cv2 as cv
cap = cv.VideoCapture(0)
if not cap.isOpened():
    print("Cannot open camera")
    exit()
while True:
    # 逐帧捕获
    ret, frame = cap.read()
    # 如果正确读取帧,ret为True
    if not ret:
        print("Can't receive frame (stream end?). Exiting ...")
        break
    # 我们在框架上的操作到这里
    gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
    # 显示结果帧e
    cv.imshow('frame', gray)
    if cv.waitKey(1) == ord('q'):
        break
# 完成所有操作后,释放捕获器
cap.release()
cv.destroyAllWindows()
View Code

编译Cpython

pip install Cpython
#在/utils/mesh/cython打开cmd,activate “虚拟环境”,运行下两行
python setup.py build_ext --inplace
python setup.py install

 

标签:masker,python,frame,cap,ret,face,install,cv
From: https://www.cnblogs.com/su1212/p/16740873.html

相关文章

  • 6、C++ 静态编译链接使用库,及例子libfacedetection人脸识别应用
    直接上例子:存在三个文件 example.cpp中的文件#include<iostream>#include"function.h"usingnamespacestd;intfun(inta,intb);intmain(){cout<<fun(2,3)<<endl;cout<<......
  • Ubuntu22.04 Windows10安装netifaces失败的问题
    执行命令pipinstall-ihttp://pypi.douban.com/simple/--trusted-host=pypi.douban.com/simplesyfthagrid来安装pysyft和hagrid,但是卡在了netifaces上,重新pipinstall......
  • IfcCurveOnSurface
    IfcCurveOnSurface类型定义IfcCurveOnSurface允许在参数曲面上选择曲线类型。 注:根据ISO/CD10303-42:2092定义曲面上的曲线是参数曲面上的曲线。它可能是以下任......
  • golang map 和 interface 的一些记录
    golang的map读取是不需要判断key是否存在的,不存在的key会返回默认值。如果map的value是interface,那么interface是需要先进行类型转换的,非要求类型的转换,得到结果是nil。......
  • Facebook – Reviews (Graph API)
    前言企业网站经常需要放customerreviews来增加conversion.常见的Reviews平台有FacebookReviews和GoogleReviews.这篇,我将介绍如果通过ASP.NETCorecalli......
  • on the IPv6 loopback interface: 'Cannot assign requested address'
    .netcore+docker  需要修改两个地方Dockerfile添加 ENVASPNETCORE_URLS=http://+:44303  FROMmcr.microsoft.com/dotnet/aspnet:6.0ASbaseENVASPNETCORE......
  • IfcBSplineSurfaceForm
    IfcBSplineSurfaceForm类型定义IfcBSplineSurfaceForm表示某个特定形状的曲面的一部分。 注:定义符合ISO/CD10303-42:1992此类型用于指示B样条曲线曲面表示某种特定......
  • 【Java基础】关键字:interface
    1.interface说明Java中不支持多继承,但有时必须从几个类中派生出一个子类,继承它们所有的属性和方法,使用interface达到多重继承的效果。interface:接口,定义一组规则,是“能......
  • huggingface-(2)
    #Filemodel.py#-*-coding:utf-8-*-importtorchimportosfromtorchimportnnfromtransformersimportBertForSequenceClassification,BertConfig​clas......
  • 安装程序无法自动安装 Virtual Machine Communication Interface Sockets (VSock) 驱
    安装程序无法自动安装VirtualMachineCommunicationInterfaceSockets(VSock)驱动程序,必须手动安装此驱动程序遇到的问题:虚拟机中安装的win7系统,在安装VMtools的时......