Giter Site home page Giter Site logo

bernard24 / ris Goto Github PK

View Code? Open in Web Editor NEW
27.0 27.0 17.0 1.05 MB

Implementation of the approach described in the paper "Recurrent Instance Segmentation" https://arxiv.org/abs/1511.08250.

License: MIT License

Jupyter Notebook 91.16% Lua 8.54% Shell 0.04% M 0.02% MATLAB 0.24%

ris's People

Contributors

bernard24 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ris's Issues

Is Upsample operation just a convolution in Upsample.lua?

a_conv = nn.SpatialConvolution( n_channels, n_channels, kernel_size, kernel_size, kernel_stride, kernel_stride, math.ceil((factor-1)/2) )
With the usuaI function nn.SpatialConvolution , I could not see how the size of input can get factor times lager. Please tell me where I am wrong.

puzzles about plants_utils.create_instance.lua

In the function plants_utils.create_instance the code seems to return 2 values , the input image and the gt_tensor , but I carefully review the code and I can only find gt_tensor in the code in 5 places below in the figure :
It seems that the value gt_image carries the annotation information and the gt_tensor seems like a nil value , but why you return the gt_tensor? Or have I understood something wrong?
image

is it normal for a slow convergence?

I am trying to apply this method to detect other objects, however, even there is only one training sample without augmentation operation, this framework is hard to convergence? Is it normal? I follow the training method for people segmentation, and only train the 8-2 and lstm model.

Training steps

When training for plants I am getting an error on the following line.

./plants_utils.lua:93: in function 'create_instance'

I have downloaded the data and dropped in the proper folders. Created the following files.

list_filename = input_path .. 'data_list.txt'
labels_filename = gt_path .. 'label_list.txt'

What are the steps to training?

Training people segmentation

When I run the launcher.sh in people_learning folder, showing that "module 'IoU3Criterion' not found".
There may be some files missing ?

pretrained model

hi @bernard24

2 quick questions

1- do you have a pretrained model for the leaf segmentation problem that I can experiment with? I am training RIS on my own dataset but it is very slow and RAM hungry. See below for my training config.

2- I am not using curriculum learning (and learning directly on 20 seq), since my test images have potentially many many leaves. Could I run a NxN sliding window over my original large image with potentially many plants and give the window image as input to the trained RIS?

cmd:option('-seq_length', 20, 'Maximum number of RNN iterations at training stage')
cmd:option('-lambda', 1, 'Hyperparameter pondering the classification accuracy term.')
cmd:option('-pass_output', 0, 'Pass previous output as input')
cmd:option('-non_object_iterations', 1, 'Number of iterations over the number of objects apearing in an image')
cmd:option('-height', 530, 'Height of the resized images')
cmd:option('-width', 500, 'Width of the resized images')
cmd:option('-learn_pre', 0, 'Whether learning Pre-CNN model')
cmd:option('-learn_cnn', 1, 'Whether learning CNN model')
cmd:option('-learn_lstm', 1, 'Whether learning LSTM model')
cmd:option('-learn_post_lstm', 1, 'Whether learning post-LSTM model')
cmd:option('-learning_rate', 10^-4, 'Learning rate')
cmd:option('-data_dir', '/scratch/.../plant/train/', 'Data directory')
cmd:option('-rnn_channels', 30, 'Number of channels of the rnn state')
cmd:option('-rnn_layers', 2, 'Number of layers of the rnn')
cmd:option('-rnn_filter_size', 3, 'Size of the filter of the rnn')
cmd:option('-cnn_filter_size', 3, 'Size of the filter of the cnn')
cmd:option('-it', 1000, 'Training iterations')

best

Peyman

Why there exists error when loading images in plants_utils.create_instance?

@bernard24

I have prepared the data (more than 20000 images including the source image and annotation image )and modified the path, and run launcher.sh , but got this error: (
/home/jcc/torch/install/bin/luajit: /home/jcc/torch/install/share/lua/5.1/image/: No such file or directory/img_10_10.png
stack traceback:
[C]: in function 'error'
/home/jcc/torch/install/share/lua/5.1/image/init.lua:352: in function 'load'
./plants_utils.lua:42: in function 'create_instance'
experiment.lua:243: in main chunk
[C]: in function 'dofile'
.../jcc/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00406670
I have set the image data file path to '../Data/Train/' in experiment.lua , why Torch seems to ignore '../Data/Train' itself and report this bug?

And if I used absolute path, like '/home/jcc/code/RIS-master/Data/Train/', Torch seems to ignore '/home/jcc/cod' and the error is like this
/home/jcc/torch/install/bin/luajit: /home/jcc/torch/install/share/lua/5.1/image/: No such file or directorye/RIS-master/Data/Train/img_10_10.png
stack traceback:
[C]: in function 'error'
/home/jcc/torch/install/share/lua/5.1/image/init.lua:352: in function 'load'
./plants_utils.lua:42: in function 'create_instance'
experiment.lua:243: in main chunk
[C]: in function 'dofile'
.../jcc/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00406670

So weird !

puzzles about the code and training process

How to perform leaf segmentation on the cvppp dataset after I finished training?(part of the training log:
image

Besides, if I directly use the weird output of the fcn, there is error in this line:
lst = protos.rnn:forward{x, unpack(rnn_state[t-1])}
the error reads like this:
...~torch/install/share/lua/5.1/nn/CAddTable.lua:16: bad argument #2 to 'add' (sizes do not match at /tmp/luarocks_cutorch-scm-1-4319/cutorch/lib/THC/generated/../generic/THCTensorMathPointwise.cu:198)
stack traceback:
[C]: in function 'add'
........

The inference code I use is here
leaf_seg_infer.txt

Could you please give some advice? Or give a demo for inference the leaf segmentation?

Thanks a lot!

What data was used for training plants and people?

I downloaded the mentioned plants phenotyping datasets but the folder structure inside is different. In your script you use by default a folder called /Data/LSCData/A1/ . Where can I get the data you used as a compressed file?

Plants Inference - Is infer_example.lua complete?

Hi @bernard24

As mentioned in issue #5 , in order to run infer_example.lua I have to find a trained model to do the inference with. This brings up several confusions:

  1. Which model do I use? 'plants_convlstm.model' or 'plants_pre_lstm.model'
  2. When using torch.load() to load either of the above models, this error appears: unknown Torch class <torch.CudaTensor>
    Adding require 'cunn' and 'cudnn' moves me past this error.
  3. Although the model is loaded and can be printed (ie. the model is not nil), I cannot call model:forward(input) on the model. This error appears: attempt to call method 'forward' (a nil value)

I'm not too sure how this script should be altered or how it should be reading in models or even which models.

Please let me know if you'd like more detailed error stack traces.
Also, excuse me - I am very new to Torch & Lua.
Thank you!

How to change batch_size for training using plants_training code ?

I used my own dataset and it has more than 11000 training images. I directly use the plant_training code, training from scratch, but the training did not seem to converge. And at the beginning the training seemed weird too:

image

So is it caused by the batch_size? Should I change batch_size from 1 to 32 or more? Could you please give some advice?

Besides,
1.--- In your paper you said you use one image for each batch in leaf segmentation experiments , so how to change the batch-size? Do I need to modify MatchCriterion.lua to adapt to mini-batch mode?

2.---what is the batch_size for your coco dataset experiments?

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.