- 博客(3)
- 收藏
- 关注
原创 tf.where
tf.where(tensor,a,b) a,b为和tensor相同维度的tensor,将tensor中的true位置元素替换为a中对应位置元素,false的替换为b中对应位置元素。 ...
2019-08-27 15:16:08 48
原创 python中的with
例:文件处理 打开-读写-关闭 普通版: file = open("/tmp/foo.txt") data = file.read() file.close() 有两个问题: 一是可能忘记关闭文件句柄; 二是文件读取数据发生异常,没有进行任何处理。 处理异常的加强版本: try: f = open('xxx') except: print 'fail to open' e...
2019-08-27 11:55:33 37
原创 toVOC
for i in range(0, len(ID)): bbxes = bbox[i] idx = ID[i] path = “Human Body Image/%05d.jpg” % (idx) if not shutil.os.path.exists(path): print(path) continue im = io.imread(path) head = headstr % (idx, ...
2019-08-27 10:06:57 94
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人