• Stars
    star
    204
  • Rank 190,926 (Top 4 %)
  • Language
    Jupyter Notebook
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

an numpy-based implement of PointRend

PointRend

An numpy-based implement of PointRend

This is an implement a PointRend function for Segmentation result refinement. The paper can be find at https://arxiv.org/pdf/1912.08193.pdf The official implement can be find at https://github.com/facebookresearch/detectron2/tree/master/projects/PointRend

Usage

copy the pointGenerate.py to your directory and you are ready to rock.

from pointGenerate import getpoint
my_mask = np.asarray(Image.open("tree_mask.jpg").resize((32,32)))
# convert this 3-channel binary mask to a 1-channel binary one
my_mask = my_mask[:,:,0]
# get the point, nearest_neighbor chose the sample points locations
points = getpoint(my_mask, k=2, beta = 0.95, nearest_neighbor=1)

# plot the result
points = list(zip(*points))
plt.imshow(my_mask,cmap="Purples")
plt.scatter(points[1],points[0],c='black',s=4)

Some result

the original image and mask:

mask img

when the mask is 32*32

mask size 32

when the mask is 64*64 mask size 32

when the mask is 128*128 mask size 32

Improvement

When I was using this, I find the speed is horrible , so I improved the point selection process by storing the it. The point selection process is significantly accelerated while the image is large. However you want to use the old one, just use getpoint(new_if_near=False). The performance improvement is shown below, and a fancy but totally unnecessary figure is plotted.

#points original improved
196 6.11 ms ± 122 µs 1.3 ms ± 8.4 µs
1960 61.8 ms ± 2.92 ms 3.93 ms ± 383 µs
19600 609 ms ± 14.3 ms 28.2 ms ± 643 µs
196000 6.28 s ± 99.9 ms 267 ms ± 12.7 ms

performance improvement

In the future

  1. We will test this on V-Net to see if there are some segmentation performance boost.
  2. If any one feel like trying the PointRend on Mask-rcnn, leave the comments in the issue.

More Repositories

1

LoRA-ViT

Low rank adaptation for Vision Transformer
Python
326
star
2

Sam_LoRA

Low rank adaptation for segmentation anything model (SAM)
Python
191
star
3

Bloody_pressure_monitor

一个基于Arduino的血压计的开源项目。An open source sphygmomanometer develped on Arduino.
C++
53
star
4

simpleITK-Snap

A qt-based 3D data visualization tool.
Python
51
star
5

CVFPaperHelper

Automatically download multiple papers by keywords in CVPR
Python
51
star
6

MicEye

Record radiologists' eye gaze when they are labeling images.
Python
43
star
7

vit3d-pytorch

3D Vision Transformer, in PyTorch
Python
28
star
8

PyEyetracker

A python interface for the Tobii Eye Tracker
C++
17
star
9

VoxelRend

A modified pointrend for 3D medical image
Python
8
star
10

MICCAI-AUTHOR-STATS

In this project, I did a survey with all the papers in MICCAI 2010-2018 to find relation between scholars.
Jupyter Notebook
8
star
11

TenGigaRays

A very simple C++ ray tracing render.
C++
6
star
12

contrastive_learning_in_100_lines

A simple and intuitive contrastive learning implementation
Python
6
star
13

Pod

python oxford dictionary
Python
3
star
14

WTF_RequirementCheck

A tool check the requirement of TF in windows
Python
3
star
15

OpenEyeTracker

An open source solution for eye tracker hardware and software.
2
star
16

VNet-PyTorch

A flexible, elegant and parallel V-Net implement in PyTorch.
2
star
17

MeLo

Medical image Low-rank adaptation for diagnosis, segmentation and generation.
JavaScript
2
star
18

JamesQFreeman

2
star
19

SA-INR

We propose a single super-resolution network for continuous reduction of MR slice spacing
Python
1
star
20

jamesqfreeman.github.io

1
star