Giter Site home page Giter Site logo

pointrend-pytorch's Introduction

PointRend

A PyTorch implementation of PointRend: Image Segmentation as Rendering

title


This repo for Only Semantic Segmentation on the PascalVOC dataset.

Many details differ from the paper for feasibilty check.


Reproduce Fig 5.

Sampled Points showing from different strategies on A Dog image.

See test_point_sampling.ipynb

Original Figure

fig5

Reference : Pytorch Deeplab Tutorial


How to use:

First, fix data path in default.yaml

Multi GPU Training See details in Single GPU Training

➜ python3 -m torch.distributed.launch --nproc_per_node={your_gpus} main.py -h

Sinle GPU Training

➜ python3 main.py -h
usage: main.py [-h] config save

PyTorch Object Detection Training

positional arguments:
  config      It must be config/*.yaml
  save        Save path in out directory

optional arguments:
  -h, --help  show this help message and exit

e.g.)

python3 main.py config/default.yaml test_codes

pointrend-pytorch's People

Contributors

alexander-kirillov avatar minho-comcom-ai avatar zsef123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pointrend-pytorch's Issues

question:loss=0,seg=0,point=0

Thank you for your contribution, I in the use of the network to train their own data set, data format shall be carried out in accordance with the format of cityscapes only, use the command: python3. Main py configs/default yaml/output, the code can run, but the training of the output loss value, seg, point from the first epoch start all is 0 (I got the five categories, semantic segmentation), want to excuse me, what should be the problem?

About "points"

Excuse me, in "points", does p[:,:,0] represent the x-coordinate or the y-coordinate?

so many bugs in this project

so many bugs in this project, eg : the label is wrongly normalized to 0-1 ..... and the mlp is a single 1*1 conv even without a relu , Hope author repair soon

In Class-PointHead: “During inference, subdivision uses N=8096” Why is 8096?

Thanks for your contribution.
Here are the code-comments in pointrend.py class: PointHead-inference:
"""
During inference, subdivision uses N=8096
(i.e., the number of points in the stride 16 map of a 1024×2048 image)
"""
i found this N=8096 in paper: "5.Experiments: SemanticSegmentation" and as same as your code variable N. I don't understand how to get this N. Is it related to the size of the input image?or maybe something else?

is this project done?

is this project done or in process your project?

I want to run this your project but not smooth..

about the resnet53

I saw in your code that the first conv of resnet53 should be replaced by three 3x3 convs, but your code only wrote one conv.

There is a bug in inference stage

In the training stage, the samplepoint func return a tensor while in the inference stage it is asked to return a tuple with point_idx and point

Necessary modification

Hi~
I made some necessary modification to run your code. The most important part is in pintrend.py:

def inference(self, x, res2, out):

    B = x.shape[0]
    _, C_res2, H_res2, W_res2 = res2.shape

    while out.shape[-1] != x.shape[-1]:
        # N = out.shape[-2] * out.shape[-1]
        out = F.interpolate(out, scale_factor=2, mode="bilinear", align_corners=True)

        _, C_out, H_out, W_out = out.shape
        points = sampling_points(out, training=False, N=4048)
        coarse = torch.gather(out.view(B, C_out, -1), 2,
                              points.unsqueeze(1).expand(-1, C_out, -1))

        stride_y = H_out // H_res2 
        stride_x = W_out // W_res2
        points_index_x = points // W_out // stride_x
        points_index_y = points % W_out // stride_y
        res2_points = (points_index_x * W_res2 + points_index_y).long()

        fine = torch.gather(res2.view(B, C_res2, -1), 2,
                            res2_points.unsqueeze(1).expand(-1, C_res2, -1))
        feature_representation = torch.cat([coarse, fine], dim=1)

        rend = self.mlp(feature_representation)

        out = out.view(B, C_out, -1).scatter_(2, points.unsqueeze(1).expand(-1, C_out, -1), rend)
        out = out.view(B, C_out, H_out, W_out)

Can u grant me to the acccess rights, so I can make a PR. thx a lot
I am interested in implementing it in maskrcnn
@zsef123

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.