资源简介
Weakly Supervised Segmentation with Tensorflow. Implements instance segmentation as described in Simple Does It: Weakly Supervised Instance and Semantic Segmentation, by Khoreva et al. (CVPR 2017).
代码片段和文件信息
“““
bboxes.py
Bounding box utility functions.
Written by Phil Ferriere
Licensed under the MIT License (see LICENSE for details)
based on:
- https://github.com/matterport/Mask_RCNN/blob/master/utils.py
Copyright (c) 2017 Matterport Inc. / Written by Waleed Abdulla
Licensed under the MIT License
References for future work:
- https://github.com/tensorflow/models/blob/master/research/object_detection/utils/np_box_ops.py
https://github.com/tensorflow/models/blob/master/research/object_detection/utils/ops.py
Copyright 2017 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License Version 2.0
- https://github.com/tangyuhao/DAVIS-2016-Chanllege-Solution/blob/master/Step1-SSD/tf_extended/bboxes.py
https://github.com/tangyuhao/DAVIS-2016-Chanllege-Solution/blob/master/Step1-SSD/bounding_box.py
Copyright (c) 2017 Paul Balanca / Written by Paul Balanca
Licensed under the Apache License Version 2.0 January 2004
“““
import numpy as np
def extract_bbox(mask order=‘y1x1y2x2‘):
“““Compute bounding box from a mask.
Param:
mask: [height width]. Mask pixels are either >0 or 0.
order: [‘y1x1y2x2‘ | ]
Returns:
bbox numpy array [y1 x1 y2 x2] or tuple x1 y1 x2 y2.
based on:
https://stackoverflow.com/questions/31400769/bounding-box-of-numpy-array
“““
horizontal_indicies = np.where(np.any(mask axis=0))[0]
vertical_indicies = np.where(np.any(mask axis=1))[0]
if horizontal_indicies.shape[0]:
x1 x2 = horizontal_indicies[[0 -1]]
y1 y2 = vertical_indicies[[0 -1]]
# x2 and y2 should not be part of the box. Increment by 1.
x2 += 1
y2 += 1
else:
# No mask for this instance. Might happen due to
# resizing or cropping. Set bbox to zeros
x1 x2 y1 y2 = 0 0 0 0
if order == ‘x1y1x2y2‘:
return x1 y1 x2 y2
else:
return np.array([y1 x1 y2 x2])
def extract_bboxes(mask):
“““Compute bounding boxes from an array of masks.
Params
mask: [height width num_instances]. Mask pixels are either >0 or 0.
Returns:
bbox numpy arrays [num_instances (y1 x1 y2 x2)].
“““
boxes = np.zeros([mask.shape[-1] 4] dtype=np.int32)
for i in range(mask.shape[-1]):
boxes[i] = extract_bbox(mask[: : i])
return boxes.astype(np.int32)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-07-15 08:29 tfwss-master\
文件 1219 2018-07-15 08:29 tfwss-master\.gitignore
文件 1070 2018-07-15 08:29 tfwss-master\LICENSE
文件 8455 2018-07-15 08:29 tfwss-master\README.md
目录 0 2018-07-15 08:29 tfwss-master\tfwss\
文件 2447 2018-07-15 08:29 tfwss-master\tfwss\bboxes.py
文件 21748 2018-07-15 08:29 tfwss-master\tfwss\dataset.py
目录 0 2018-07-15 08:29 tfwss-master\tfwss\img\
文件 39737 2018-07-15 08:29 tfwss-master\tfwss\img\2008_000203.jpg
文件 37489 2018-07-15 08:29 tfwss-master\tfwss\img\2008_000219.jpg
文件 28139 2018-07-15 08:29 tfwss-master\tfwss\img\2008_000553.jpg
文件 20152 2018-07-15 08:29 tfwss-master\tfwss\img\2008_000581.jpg
文件 52708 2018-07-15 08:29 tfwss-master\tfwss\img\2008_000657.jpg
文件 27581 2018-07-15 08:29 tfwss-master\tfwss\img\2008_000727.jpg
文件 25443 2018-07-15 08:29 tfwss-master\tfwss\img\2008_000795.jpg
文件 34823 2018-07-15 08:29 tfwss-master\tfwss\img\2008_000811.jpg
文件 32854 2018-07-15 08:29 tfwss-master\tfwss\img\2008_000825.jpg
文件 42743 2018-07-15 08:29 tfwss-master\tfwss\img\2008_000839.jpg
文件 27821 2018-07-15 08:29 tfwss-master\tfwss\img\2008_000957.jpg
文件 24394 2018-07-15 08:29 tfwss-master\tfwss\img\2008_001113.jpg
文件 33931 2018-07-15 08:29 tfwss-master\tfwss\img\2008_001199.jpg
文件 50882 2018-07-15 08:29 tfwss-master\tfwss\img\2008_001867.jpg
文件 43266 2018-07-15 08:29 tfwss-master\tfwss\img\2008_002191.jpg
文件 26811 2018-07-15 08:29 tfwss-master\tfwss\img\2008_002673.jpg
文件 38417 2018-07-15 08:29 tfwss-master\tfwss\img\2008_003055.jpg
文件 46450 2018-07-15 08:29 tfwss-master\tfwss\img\2008_003141.jpg
文件 16254 2018-07-15 08:29 tfwss-master\tfwss\img\data_files.png
文件 63958 2018-07-15 08:29 tfwss-master\tfwss\img\vgg16.png
文件 140495 2018-07-15 08:29 tfwss-master\tfwss\img\vgg_16_4chan_weak_dsn2_loss.png
文件 139545 2018-07-15 08:29 tfwss-master\tfwss\img\vgg_16_4chan_weak_dsn3_loss.png
文件 134404 2018-07-15 08:29 tfwss-master\tfwss\img\vgg_16_4chan_weak_dsn4_loss.png
............此处省略25个文件信息
相关资源
- Python-UNet用于医学图像分割的嵌套UN
- Python-基于tensorflow实现的用textcnn方法
- Python-Keras实现Inceptionv4InceptionResnetv1和
- Python-pytorch中文手册
- Python-FastSCNN的PyTorch实现快速语义分割
- Python-滑动窗口高分辨率显微镜图像分
- Python-使用MovieLens数据集训练的电影推
- Python-机器学习驱动的Web应用程序防火
- Python-subpixel利用Tensorflow的一个子像素
-
Python-汉字的神经风格转移Neuralst
y - Python-神经网络模型能够从音频演讲中
- Python-深度增强学习算法的PyTorch实现策
- Python-基于深度学习的语音增强使用
- Python-基于知识图谱的红楼梦人物关系
- Python-STGAN用于图像合成的空间变换生
- Python-利用GAN进行图片填充
- Python-基于50W携程出行攻略的顺承事件
- Python-在TensorFlow中实现实现图像卷积网
- Python-60DaysRLChallenge中文版强化学习6
- Python-一个非常简单的BiLSTMCRF模型用于
- Python-Tensorflow仿AlphaGo框架实现的AI围棋
- Python-我是小诗姬全唐诗作为训练数据
- Python-用于物体跟踪的全卷积连体网络
- Python-数学建模竞赛中所使用的相关算
- Python-MonoDepthPyTorchPyTorch无监督单目深
- Python-用Tensorflowjs实现的可回收非可回
- Python-利用TensorFlow中的深度学习进行图
- Python-TensorFlow快速入门与实战课件与参
- Python-FCN完全卷积网络中最简单最容易
- Python-匈牙利算法卡尔曼滤波器多目标
评论
共有 条评论