I'm using dlib for face detection and getting this error

Exception:  'dlib.mmod_rectangle' object has no attribute 'right'

What is the problem? I'm using cnn version of dlib which should run on gpu and here is the code

detector = dlib.cnn_face_detection_model_v1('mmod_human_face_detector.dat')
img = dlib.load_rgb_image(img_path)
dets = detector(img, 1)

Solution 1

If you use cnn version of dlib, it does not return you simple rectangle. It returns you an instance of a class, which have the rectangle inside of it.

class dlib.mmod_rectangle:
# Wrapper around a rectangle object and a detection confidence score.
confidence
rect

This is the definitation of the class. it has a field rect, where you can find your points. http://dlib.net/python/index.html#dlib.mmod_rectangle

aipool: https://ai-pool.com/d/exception____dlib_mmod_rectangle__object_has_no_attribute__right_

Exception: 'dlib.mmod_rectangle' object has no attribute 'right' - 例外:'dlib.mmod_rectangle'对象没有属性'right'的更多相关文章

  1. AttributeError: 'tuple' object has no attribute 'extend'

    出错demo In [5]: a.extend([4,5]) --------------------------------------------------------------------- ...

  2. AttributeError: 'module' object has no attribute 'Thread'

    $ python thread.py starting at: 2015-08-05 00:24:24Traceback (most recent call last):  File "th ...

  3. 解决window7 x64位Anaconda启动报错:AttributeError: '_NamespacePath' object has no attribute 'sort'

    最近论文需要用到python做数据分析,python语法简单,但是Windows下安装第三方包恶心的要命,statsmodels用pip死活安装不上,网上查了说包相互依赖windows下的pip不能下 ...

  4. AttributeError: 'NoneType' object has no attribute 'split' 报错处理

    报错场景 social_django 组件对原生 django 的支持较好, 但是因为 在此DRF进行的验证为 JWT 方式 和 django 的验证存在区别, 因此需要进行更改自行支持 JWT 方式 ...

  5. 解决Win7(x64)Anaconda3报错:AttributeError: '_NamespacePath' object has no attribute 'sort'

    最近论文需要用到python做数据分析,python语法简单,但是Windows下安装第三方包恶心的要命,statsmodels用pip死活安装不上,网上查了说包相互依赖windows下的pip不能下 ...

  6. 测试类执行报错:AttributeError: 'Testlei' object has no attribute 'test_cases' 和data,unpack用法解析

    a=[{"}] import unittest from ddt import ddt,data,unpack @ddt class Testlei(unittest.TestCase): ...

  7. AttributeError: 'unicode' object has no attribute 'tzinfo' 未解决

    Internal Server Error: /demo/machineinfo.htmlTraceback (most recent call last): File "C:\Python ...

  8. Django 运行报异常:AttributeError: 'str' object has no attribute 'get'

    Technorati Tags: Python,Django,Web 在使用django.contrib.auth用户机制进行用户的验证.登录.注销操作时,遇到这个异常. 首先是写了一个登录的视图,要 ...

  9. Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法

    最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...

随机推荐

  1. Springboot 配置类( @Configuration) 不能使用@Value注解从application.propertyes中加载值以及Environment为null解决方案

    最近遇到个场景,需要在使用@Bean注解定义bean的时候为对象设置一些属性,比如扫描路径,因为路径经常发布新特性的时候需要修改,所以就计划着放在配置文件中,然后通过@ConfigurationPro ...

  2. ColumnStore完整验证指南之安装与启动停止

    官方文档https://mariadb.com/kb/en/library/mariadb-columnstore/ 推荐使用最新1.2.x最新版本. 先决条件 yum -y install boos ...

  3. SQL-递归查询在Ora与Mssql

    今天在工作中,有同事“请教”从 Sql Server 移植数据到 DM DB 的改写问题,本以为难度不大,结果发现 Sql Server 数据库的语法.架构上,与 Oracle / DM 数据库差异还 ...

  4. 爬坑系列----Redis查询key报空指针异常,而redis中确实存在该key

    现象: 1.在A方法中根据key查询一个list,可以获取到相应的值 2.在B方法中同样调用此方法,传入相同的key,查询不到值,为null,报空指针异常 起初我也一脸懵逼,到现在虽然解决了,还是不知 ...

  5. Weblogic漏洞修复记录

    1.CVE-2018-2628.CVE-2018-2893 以上两个漏洞均是针对weblogic的t3服务进行攻击,如果有条件的,可以从oracle官网下载最新的补丁安装http://www.orac ...

  6. go-switch特点

    程序中遇到有枚举分支逻辑时,需要用到 switch 代替多个 if else 判断. 学习过程遇到一些与C#不同点,记录下. 语法: switch expr { case x1 : //expr为x1 ...

  7. 目标指定法——S.M.A.R.T.

    一个有效的目标一定要是 具体的(Specific), 可测量的(Measureable), 可实现的(Attainable), 有现实意义的(Realistic), 以及有明确期限的(Time-bas ...

  8. HDU 1560 DNA sequence(DNA序列)

    HDU 1560 DNA sequence(DNA序列) Time Limit: 15000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K  ...

  9. eclipse 下修改Dynamic Web Modulle 的问题

    上图右侧圈中位置  有提示对应jdk版本. 若在eclipse修改Dynamic Web Modulle 为3.0失败,可以去项目工作空间文件中的.seting文件下修改: 上图对应的 <ins ...

  10. 基于三层架构项目下的Ado【六】

    一.基于三层架构项目下的Ado增删改查总结,提示:现在一般都是使用EF框架操作. 1. 先在model层创建出一个和你将会查询出一样类型的表,比如你将查询出的有五个字段,那么你就需要创建出一个和你查询 ...