参考链接: Python中的numpy.eye

在使用python写美颜算法时,出现一个bug,AttributeError: 'numpy.ndarray' object has no attribute 'brighten',brighten方法是我自己写的,然后调用。

im = cv.imread(src_file, cv.IMREAD_COLOR)

thin_face=thin_face.thin_face(im,face_point,70)

big_eye=big_eye.enlarge_eyes(thin_face,face_point,radius=20, strength=10)

big_eye=big_eye.astype(np.uint8)

new_face_point=read_im_and_landmarks(big_eye)

new_face_point=read_point(face_point)

mouth_mask=get_face_mask(big_eye,face_point[48:61])

red_mouth=thin_face.brighten(big_eye,mouth_mask,rate=0.7)

错误:

如果我将big_eye换成原图,模型就能调用并跑通,但是不是我需要的效果,查找很久,还问了大神了,发现是自己命名不规范导致的,这里记录就给自己做个提醒吧,上面自己写的方法名是thin_face,后面的结果又是thin_face,导致,后面调用混乱,所以报错,后面需要规范化写。

[转载] python 调用自己的方法报错,numpy.ndarray object has no attribute brighten相关推荐

  1. python中使用ZADD方法报错AttributeError: 'int' object has no attribute 'items'

    redis的版本关系 正确的完整实例如下: import pymongo import redis# 代码作用是mongodb的数据传送到redis中去 handler = pymongo.Mongo ...

  2. execjs 模块 call() 方法报错 AttributeError: ‘NoneType‘ object has no attribute ‘replace‘

    使用 execjs 模块的 call() 方法时报两处错误 data = execjs.compile(open('15_exercise.js', 'r', encoding='utf-8').re ...

  3. vue父组件调用子组件方法报错的解决方法

    vue父组件调用子组件方法报错 在父组件定义了一个tab标签页,每一个标签页下面都调用不同的组件,如下图所示: 子组件中定义的方法: setup() {const getList = () => ...

  4. Python 保存数组至.mat文件,报错:AttributeError: 'numpy.ndarray' object has no attribute 'items'

    Python保存数组的方式有很多种,如savetxt,但这个函数只能保存一维或二维数组.为了保存高维数组,同时能够在matlab载入,可以使用scipy.io.savemat()函数,例子: impo ...

  5. [转载] AttributeError: ‘numpy.ndarray‘ object has no attribute ‘insert‘的解决方法

    参考链接: Python中的numpy.insert AttributeError: 'numpy.ndarray' object  has no attribute 'insert' 代码: imp ...

  6. 利用sns.boxplot绘制箱型图的时候报错:AttributeError: ‘numpy.ndarray‘ object has no attribute ‘boxplot‘

    (1)问题介绍 最近在做一个机器学习入门项目,鸢尾花种类的预测,在利用sns.boxplot()绘制箱型图的时候,程序报错: AttributeError: 'numpy.ndarray' objec ...

  7. import obspy报错‘numpy.int64‘ object has no attribute ‘split‘`

    line = line.split(comment, 1)[0] AttributeError: 'numpy.int64' object has no attribute 'split' impor ...

  8. python selenium中析构方法报错sys.meta_path is None, Python is likely shutting down如何解决?

    在代码跑通之后编译器跟我说唉,你这析构中关闭的这个代码报错了然后就弹出了一堆的报错信息最后弹出来一个 ImportError: sys.meta_path is None, Python is lik ...

  9. MyBatis-Plus调用插入Insert()方法报错

    调用Insert方法竟然报错了,整得一脸懵逼,报错信息如下: Servlet.service() for servlet [dispatcherServlet] in context with pat ...

最新文章

  1. linux服务器dns配置丢失处理
  2. Python基础教程:list深拷贝和浅拷贝
  3. Python内置函数zip map filter的使用
  4. 硅谷最有名的帮派:如果你不知道PayPal黑帮
  5. pytorch框架快速测试你的模型结构是否存在问题并得到输出形状
  6. 全球首发1毫秒计费模式,腾讯云引领Serverless时代新标准
  7. 【服务器】Discuz论坛实现微信小程序(修改接口)
  8. Ubuntu安装R及RStudio
  9. linux环境生成pdf字体问题,字体概述与Linux字体常见问题的解决.pdf
  10. 矩阵分析及应用(1-2章)
  11. 支付宝当面付打赏系统源码
  12. 流水灯c语言程序 流程图,流水灯流程图(单片机流水灯流程图)
  13. Html5网页录音,js录音mp3
  14. 多张图片合成一张jpg工具_简单实用!3个手机拼图APP,让多张图片变为1张!
  15. mgo EnsureIndex注意事项
  16. PS练习7——蒙版的使用
  17. Postgresql通过docker进行高可用部署 pgpool-II
  18. Java实现23种设计模式教程(作者原创)
  19. mongoDB的读书笔记(04)_【Replica】(01)_Replica的一些基本概念
  20. 2p C和3p C的区别

热门文章

  1. java udp丢包重发_UDPDataPacker_Java数据报之失序和丢包
  2. birt插件 web_好用的国产web报表软件非它莫属,轻松搞定复杂报表
  3. numpy 归一化_图卷积网络到底怎么做,这是一份极简的Numpy实现
  4. 第二章 ASP.NET MVC (控制器向视图传递值(二))
  5. JavaScript的for in语法遍历对象的属性(1)
  6. 计算一个连通分量中节点的个数的两种方法
  7. vsftpd pam_mysql_vsftpd+mysql+pam虚拟用户无法登录ftp服务器,请给位大侠帮忙!
  8. 计算机组成原理—浮点数
  9. SQL注入漏洞(原理;网页注入)
  10. Unity3D之NGUI基础6:UIButton按钮