Giter VIP home page Giter VIP logo

debeshjha / 2020-cbms-doubleu-net Goto Github PK

View Code? Open in Web Editor NEW
224.0 8.0 67.0 1.53 MB

Official implementation of DoubleU-Net for Semantic Image Segmentation in TensorFlow & Pytorch (Nominated for Best Paper Award (IEEE CBMS))

Home Page: https://arxiv.org/pdf/2006.04868.pdf

Python 100.00%
semantic-segmentation cnn-keras u-net doubleunet unet-image-segmentation tensoflow doubleu-net segmentation-models pytorch-implementation convolutional-neural-networks

2020-cbms-doubleu-net's People

Contributors

debeshjha 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

2020-cbms-doubleu-net's Issues

Question about the result on MICCAI 2015

hello friend

First of all, Thank you for sharing your code.
However, I have a question about your project.
I have just trained your code with dataset (CVC-ClinicDB for training and ETIS-Larib for Testing). And I also used the same config and environment as you.
However, The result that I got is not good as your paper report?
Can you recommend to me a trick or advice to improve the result ?

Thank you so much.
Looking forward to your reply soon
@DebeshJha

Image pre-processing

Hey,

Sorry to ask such a silly question but could you help me with my images pre-processing to use your model and weights

Here is what I did :

  1. I downloaded the CVC-ClinicDB dataset. (images and masks are in tiff format)
  2. I cloned your repo and added your weights to ./files/
  3. I changed your data.py -> main() to the following :
def main():
    np.random.seed(42)
    path = "../CVC-ClinicDB/"
    test_x = glob(os.path.join(path, "Original/*"))
    test_y = glob(os.path.join(path, "Ground Truth/*"))

    create_dir("new_data/test/image/")
    create_dir("new_data/test/mask/")

    augment_data(test_x, test_y, "new_data/test/", augment=False)

At this point I had 2 folders with images in JPEG (.jpg) format but when I run the prediction, I get results like this :
43_0
73_0

When I do the same with ETIS-LaribPolypDB dataset, I get results like these :
7_0
30_0

Do you know what I'm doing wrong?
Do you have any code examples to process an image and run a prediction?
Or do you have a pre-processed image dataset?

FYI: I'm working on a school project where I want to use your model and weights as a backend and build a web gui to run predictions and have some cool gui features

training weights

hey friend,
can u share your training weights, since i want fintune your model, but haven't enough data.?

Where is ASPP in model.py?

Hi, I may have missed something, but you've mentioned using ASPP between encoder and decoder layers in both networks, but I can't see that in model.py
Could you please explain?

Comparison to ResUNet++

Hi, you have mentioned in your paper ResUNet++, which is also your work.
Also, I've seen that you are working on ResUNet++ + CRF + TTA.
Can you make a comparison between the 3 on the presented datasets?
Is any one of these models superior to the others?
Thanks.

TypeError: '<' not supported between instances of 'function' and 'str'

Im getting below error when im using your code predict.py after training on my dataset with 2 classes, please help


TypeError Traceback (most recent call last)
/content/drive/MyDrive/Colab Notebooks/2020-CBMS-DoubleU-Net/predict.py in ()
93 model = load_model_weight("/content/drive/MyDrive/Colab Notebooks/2020-CBMS-DoubleU-Net/files/dsb-model.h5")
94 model.summary()
---> 95 model.evaluate(test_dataset, steps=test_steps, verbose=1)
96 evaluate_normal(model, test_x, test_y)

10 frames
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/func_graph.py in wrapper(*args, **kwargs)
971 except Exception as e: # pylint:disable=broad-except
972 if hasattr(e, "ag_error_metadata"):
--> 973 raise e.ag_error_metadata.to_exception(e)
974 else:
975 raise

TypeError: in user code:

/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py:1224 test_function  *
    return step_function(self, iterator)
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py:1215 step_function  **
    outputs = model.distribute_strategy.run(run_step, args=(data,))
/usr/local/lib/python3.6/dist-packages/tensorflow/python/distribute/distribute_lib.py:1211 run
    return self._extended.call_for_each_replica(fn, args=args, kwargs=kwargs)
/usr/local/lib/python3.6/dist-packages/tensorflow/python/distribute/distribute_lib.py:2585 call_for_each_replica
    return self._call_for_each_replica(fn, args, kwargs)
/usr/local/lib/python3.6/dist-packages/tensorflow/python/distribute/distribute_lib.py:2945 _call_for_each_replica
    return fn(*args, **kwargs)
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py:1210 run_step  **
    with ops.control_dependencies(_minimum_control_deps(outputs)):
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py:2764 _minimum_control_deps
    outputs = nest.flatten(outputs, expand_composites=True)
/usr/local/lib/python3.6/dist-packages/tensorflow/python/util/nest.py:338 flatten
    return _pywrap_utils.Flatten(structure, expand_composites)

TypeError: '<' not supported between instances of 'function' and 'str'

InvalidArgumentsError: Incompatible shapes

When I try to run the code with ISIC 2017 skin lesion dataset I get the following error:

Epoch 1/10
Traceback (most recent call last):
  File "/content/drive/MyDrive/newceal/src/CEAL.py", line 81, in <module>
    shuffle=False)
  File "/usr/local/lib/python3.7/dist-packages/keras/utils/traceback_utils.py", line 67, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/eager/execute.py", line 55, in quick_execute
    inputs, attrs, num_outputs)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Graph execution error:

Detected at node 'IteratorGetNext' defined at (most recent call last):
    File "/content/drive/MyDrive/newceal/src/CEAL.py", line 81, in <module>
      shuffle=False)
    File "/usr/local/lib/python3.7/dist-packages/keras/utils/traceback_utils.py", line 64, in error_handler
      return fn(*args, **kwargs)
    File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 1384, in fit
      tmp_logs = self.train_function(iterator)
    File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 1021, in train_function
      return step_function(self, iterator)
    File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 1009, in step_function
      data = next(iterator)
Node: 'IteratorGetNext'
Detected at node 'IteratorGetNext' defined at (most recent call last):
    File "/content/drive/MyDrive/newceal/src/CEAL.py", line 81, in <module>
      shuffle=False)
    File "/usr/local/lib/python3.7/dist-packages/keras/utils/traceback_utils.py", line 64, in error_handler
      return fn(*args, **kwargs)
    File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 1384, in fit
      tmp_logs = self.train_function(iterator)
    File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 1021, in train_function
      return step_function(self, iterator)
    File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 1009, in step_function
      data = next(iterator)
Node: 'IteratorGetNext'
2 root error(s) found.
  (0) INVALID_ARGUMENT:  Incompatible shapes at component 0: expected [?,384,512,3] but got [32,512,384,3].
	 [[{{node IteratorGetNext}}]]
	 [[assert_less_equal/Assert/AssertGuard/else/_11/assert_less_equal/Assert/AssertGuard/Assert/data_0/_328]]
  (1) INVALID_ARGUMENT:  Incompatible shapes at component 0: expected [?,384,512,3] but got [32,512,384,3].
	 [[{{node IteratorGetNext}}]]
0 successful operations.
0 derived errors ignored. [Op:__inference_train_function_15637]

I passed the data through the data.py class normally and I tried changing tensorflow and keras to multiple other versions but nothing seems to work

Performance issue in /train.py (by P3)

Hello! I've found a performance issue in /train.py: dataset.batch(batch)(here) shoule be called before dataset.map(map_func=parse_data)(here), which could make your program more efficient.

Here is the tensorflow document to support it.

Besides, you need to check the function parse_data called in dataset.map(map_func=parse_data) whether to be affected or not to make the changed code work properly. For example, if parse_data needs data with shape (x, y, z) as its input before fix, it would require data with shape (batch_size, x, y, z) after fix.

Looking forward to your reply. Btw, I am very glad to create a PR to fix it if you are too busy.

Python environment

Hi, thank you for sharing the wonderful code!

Could you share the python environment (python version, TensorFlow/Keras version, and other required libraries)?

Thank you in advance!

InvalidArgumentError

While training this model on the ISIC2017 dataset, this is the error I am getting.
Image size is (768,1024,3)

InvalidArgumentError: 2 root error(s) found.
  (0) Invalid argument:  Cannot batch tensors with different shapes in component 1. First element had shape [768,1024,2] and element 2 had shape [576,767,2].
	 [[node IteratorGetNext (defined at <ipython-input-22-ce863f058b06>:99) ]]
  (1) Invalid argument:  Cannot batch tensors with different shapes in component 1. First element had shape [768,1024,2] and element 2 had shape [576,767,2].
	 [[node IteratorGetNext (defined at <ipython-input-22-ce863f058b06>:99) ]]
	 [[Shape/_10]]

Can anyone please help?

DATA

Could you please guide us how to get the ground truth of test set for ISIC2018 challenge Lesion Boundary Segmentation dataset?

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.