import cv2
img = cv2.imread('1.jpg')
print(type(img).__module__)
if type(img).__module__ == np.__name__: print(1)

module_ 表示当前操作的对象在哪个模块
__name__的值为模块名

type(img).__module__ == np.__name__相关推荐

  1. python学习笔记011——内置函数__module__、__name__

    1 __module__描述 __module__ : 如果当前模块为顶层模块执行 则打印__main__ 如果当前模块为被调用模块的时候 打印当前模块的名称 2 __module__示例 def f ...

  2. CIFAR10分类算法记录

    CIFAR-10共有60000张图片,共有10个分类,每个分类大概6000 张,训练集共有50000张图片,测试集共有10000张图片,训练集每个分类约有 5000张图片,测试集每个分类约有1000张 ...

  3. 【Python面试】——02 type类

    我们会用type()来查看一个对象类型,这是最常见的用法:但是type还有一种完全不同的功能,它能动态的创建类.type可以接受一个类的描述作为参数,然后返回一个类. type可以查看是对象类型 ty ...

  4. FutureWarning: Passing (type, 1) or ‘1type‘ it will be understood as (type, (1,)) / ‘(1,)type‘

    FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version ...

  5. 解决import tensorflow时的报错 Passing (type, 1) or ‘1type‘ as a synonym of type is deprecate

    问题 在Pycharm中运行import tensorflow as tf时报错. 解决方案 此时点开报错中的dtypes.py文件,对其进行修改. 从# hard-coding of names.这 ...

  6. Python:设置不显示Using TensorFlow backend及FutureWarning: Passing (type, 1) or ‘1type‘ as a synonym of typ

    Python:设置不显示Using TensorFlow backend及FutureWarning: Passing type, 1 or '1type' as a synonym of type ...

  7. 详述numpy中的np.random.rand()、np.random.randn()、np.random.randint()、np.random.uniform()函数的用法

    目录 (一)np.random.rand() (二)np.random.randn() (三)np.random.randint(low,high,size,dtype) (四)np.random.u ...

  8. 【机器学习基础】numpy 简称 np

    文章目录 1 创建数组知多少 1.1 np.array 1.2 np.arange 1.3 np.random.randint 1.4 特殊函数 2 数组数据类型 2.1 指定&查看数据类型 ...

  9. Python语法学习记录(18):判断变量是否为某种类型(int,list,tuple,str,dict,np.ndarray)

    文章目录 判断变量是否为某种类型 使用isinstance进行判断python基础类型 判断变量是否为某种类型 使用isinstance进行判断python基础类型 import numpy as n ...

  10. Python np.mean()函数

    1.数组的操作: import numpy as np a = np.array([[1, 2], [3, 4]]) print(a) print(type(a)) print(np.mean(a)) ...

最新文章

  1. leanote个人版安装
  2. c#和python更适合爬虫_python在爬虫方面有哪些优势呢?
  3. 战略性基础研究的由来及国际实践研究
  4. Qt文档阅读笔记-Qt Quick 3D - Simple Example解析
  5. 数据结构动态顺序字符串基本操作实验_技术连载:数据结构 - 栈
  6. 第二章 寄存器 章节小结
  7. 马云:成功与情商有关 与读书多少关系不大
  8. grads 相关系数_Grads综合实习报告
  9. 医院药品管理系统java sql_医院药品管理系统设计(Netbeans,Myeclipse,MySQL,SQLServer)
  10. 【zoj1004 vector stack STL】anagrams by stack
  11. Word文件怎么快速查找关键词
  12. dell-inspiron 14r笔记本电脑除尘总结
  13. 随机名字获取,杜绝取名烦恼
  14. SP2限制连接数补丁!最新版本2.11a
  15. OpenGL超级宝典(第7版)之第十二章管线监控
  16. 亚马逊 广告接口对接 amazon advertising
  17. Vue脚手架使用步骤
  18. linux毁了所有数据,小心!数据在你不注意的时候居然偷偷损毁了
  19. 每日更新的电信ip段,联通ip段,铁通ip段和移动ip段
  20. 流利地回答出面试官提出的八股问题,面试官却突然说“背得不错”,该怎么回答?...

热门文章

  1. 7-汇编大小写字符互相转化+[bx+idata]+SI/DI
  2. 推荐一款专为新手用的Python开发工具
  3. Python单元测试框架——unittest
  4. struts2登陆拦截器
  5. [洛谷1681]最大正方形II
  6. [ROS]1 小乌龟
  7. Data Guard Service 相关介绍
  8. NYOJ-525 一道水题
  9. .Net下RabbitMQ的使用(4) -- 订阅和发布
  10. [UnityShader基础]04.ColorMask