tensorflow
gggi520
这个作者很懒,什么都没留下…
展开
-
使用CIOU作为YOLOv3的定位损失,focal loss作为分类损失
def box_ciou(b1, b2): """ 输入为: ---------- b1: tensor, shape=(batch, feat_w, feat_h, anchor_num, 4), xywh b2: tensor, shape=(batch, feat_w, feat_h, anchor_num, 4), xywh 返回为: ------- ciou: tensor, shape=(batch, feat_w, feat_h, a原创 2021-12-19 21:12:28 · 742 阅读 · 2 评论 -
tf获取节点的输出name onnx节点op修改
获取节点的输出nameOPS = tf.get_default_graph().get_operations() for op in OPS: for i in op.outputs: print(i.name,i.shape) OPS = tf.get_default_graph().get_operations() for op in OPS原创 2021-11-25 15:55:09 · 1789 阅读 · 0 评论 -
随机复制xml文件与相对应的jpg文件
import cv2 import numpy as np import osimport xml.dom.minidomfrom PIL import Imageimport randomdef write_xml(info): info1=info[0][0:6]+'.jpg' img_dir='JPEGImages/' im = Image.open(img_dir+info1) width,height = im.size xml_dir=.原创 2021-05-07 14:41:02 · 227 阅读 · 1 评论 -
tensorflow实现双向的逻辑判断
tensorflow实现双向d判断,例如1<a<0输出1import numpy as npimport matplotlib.pyplot as pltimport tensorflow as tfa=tf.constant([1.5 ,26.2,3.2,4.5,5.3,6.5,4])b=tf.ones_like(a)condition = tf.less(a, 2.2)...原创 2019-12-06 21:05:06 · 210 阅读 · 0 评论 -
使用opencv导入自己的图片np处理成类似mnsit数据集进行手写图片识别
@TOC使用opencv导入自己的图片np处理成类似mnsit数据集进行手写图片识别mnsit数据集读取后也是加工成矩阵或者list类型,所以为了方便对自己的少量图片进行识别,又不想很麻烦的制作数据集(大量的图片建议用https://github.com/gskielian/JPG-PNG-to-MNIST-NN-Format 制作),只需要把图片加工成矩阵的形式就可以直接输入code:im...原创 2019-09-15 15:28:20 · 500 阅读 · 0 评论 -
使用sobel算子提取图片轮廓
使用sobel算子提取图片轮廓使用sobel算子提取整幅图片的轮廓import numpy as npimport matplotlib.pyplot as pltimport matplotlib.image as mpimgimport tensorflow as tfimport pylabmyimg=mpimg.imread('00.jpg')#480,640,3full=...原创 2019-09-29 19:04:14 · 888 阅读 · 0 评论