Code Monkey home page Code Monkey logo

unsupervised-image-segmentation-by-wnet-with-normalizedcut's People

Contributors

lwchen6309 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

Watchers

 avatar  avatar  avatar  avatar

unsupervised-image-segmentation-by-wnet-with-normalizedcut's Issues

Problem with scipy.misc Training on google Colab WNET_naive.py

Pattern ./data/VOCdevkit/VOC2012/SegmentationClass/2011_005667.png
Annotation file not found for 2010_001669 - Skipping
Pattern ./data/VOCdevkit/VOC2012/SegmentationClass/2010_001669.png
Nunmber of files: 2913
Pickling ...
Initializing Batch Dataset Reader...
Traceback (most recent call last):
File "./unsupervised-image-segmentation-by-WNet-with-NormalizedCut/src/WNet_naive.py", line 194, in
train_dataset_reader, validation_dataset_reader = create_BatchDatset()
File "/content/unsupervised-image-segmentation-by-WNet-with-NormalizedCut/src/data_io/BatchDatsetReader_VOC.py", line 109, in create_BatchDatset
train_dataset = BatchDatset(data_record['training'], True)
File "/content/unsupervised-image-segmentation-by-WNet-with-NormalizedCut/src/data_io/BatchDatsetReader_VOC.py", line 127, in init
self.read_data_to_self(data_records)
File "/content/unsupervised-image-segmentation-by-WNet-with-NormalizedCut/src/data_io/BatchDatsetReader_VOC.py", line 135, in read_data_to_self
[resize_size, resize_size], interp='bilinear') for datum in data_records])
File "/content/unsupervised-image-segmentation-by-WNet-with-NormalizedCut/src/data_io/BatchDatsetReader_VOC.py", line 135, in
[resize_size, resize_size], interp='bilinear') for datum in data_records])
AttributeError: module 'scipy.misc' has no attribute 'imresize'

This function no longer works, I had to install scipy==1.0.0 and then training worked

error raised during testing of image

File "D:\deep learning codes\unsupervised-image-segmentation-by-WNet-with-NormalizedCut\src\UNet.py", line 179, in plot_segmentation_under_test_dir
colorized_test_preds = utils.batch_colorize_ndarray(test_preds,0, self.flags.num_class, self.flags.cmap)[:,:,:,:3]
IndexError: too many indices for array

Number of classes during test

Hi,

  1. I would like to know whether we have to train the W_Net with the same number of classes as we have to detect when we test it on custom images.
  2. I would also like to know, if we have to train with the same number of classes as specified by default, do we need to change that value to the number of segmentations required for our custom dataset while testing? For example, do i need to change the classes parameter in WNet_naive to 3 if i want 3 segmentations from the default number while running it in --test mode?
    Thanks.

Can you share the code that works for tensorflow 2?

I have made a lot of changes so that this code is compatible for TensorFlow latest version but I am struck at this:

Use `tf.cast` instead.
Traceback (most recent call last):
  File "WNet_bright.py", line 186, in <module>
    net = Wnet_bright(flags)
  File "WNet_bright.py", line 87, in __init__
    batch_soft_ncut = soft_ncut(self.image, image_segment, image_weights)
  File "C:\IU\Spring 2020\CSCI-B 657 Computer Vision\Project\unsupervised\wnet\unsupervised-image-segmentation-by-WNet-with-NormalizedCut\src\soft_ncut.py", line 515, in soft_ncut
    W_Ak = sparse_tensor_dense_tensordot(image_weights, image_segment, axes=2) #axes = [[2],[2]]
  File "C:\IU\Spring 2020\CSCI-B 657 Computer Vision\Project\unsupervised\wnet\unsupervised-image-segmentation-by-WNet-with-NormalizedCut\src\soft_ncut.py", line 238, in sparse_tensor_dense_tensordot
    with tf.name_scope(name, "SparseTensorDenseTensordot", [sp_a, b, axes]) as name:
TypeError: __init__() takes 2 positional arguments but 4 were given

Can you please help me with solving this? Or provide me with the version that works for Tensorflow 2.

Thank you.

Data not found?

Here is the image of the errors I'm getting: image

The first time I ran the code and got errors, it listed each of the data files and said that they were not found. Now, it just says "ValueError: need at least one array to stack", which was also present before after indicating that none of the data files were present.

I'm pretty new to using Python in Windows with Anaconda, so any ideas/help you can give are appreciated!

Error when using mode = visualize

Initializing VOC2012 Batch Dataset Reader...
Found pickle file!
Initializing Batch Dataset Reader...
Initializing Batch Dataset Reader...
2019-08-27 22:44:45.364464: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcudnn.so.7
Traceback (most recent call last):
File "./unsupervised-image-segmentation-by-WNet-with-NormalizedCut/src/WNet_naive.py", line 200, in
valid_images, preds = net.visaulize_pred(validation_dataset_reader)
File "./unsupervised-image-segmentation-by-WNet-with-NormalizedCut/src/WNet_naive.py", line 135, in visaulize_pred
utils.save_image(valid_images[itr].astype(np.uint8), self.flags.logs_dir, name="inp_" + str(5+itr),mean=1)
TypeError: save_image() got an unexpected keyword argument 'mean'

weight_variable has not been defined

In the file Soft_ncut.py there is an error that says "the module 'TensorflowUtils' has no attribute 'weight_variable'
Causing the problem is this line of code:
kernels = tf.cast(utils.weight_variable([3, 3, 3, NUM_OF_CLASSES], name="weight"), tf.float32)

Would you please let me know what should I define the weight_variable?

getting error while training wnet_bright, please guide.

File "D:\deep learning codes\unsupervised-image-segmentation-by-WNet-with-NormalizedCut\src\soft_ncut.py", line 456, in convert_to_batchTensor
new_indeces = tf.concat([tile_batch,tile_indeces],axis=1)

NameError: name 'tile_indeces' is not defined

Undefined function: unprocess_image

In line 20 of TenforflowUtils.py, the method unprocess_image() is invoked, but there is no definition of this function in the code. Please add a definition.

WNet Batch initialization Error

Hello,

I have tried using the wnet code but each time i try to train it, it says :

Initializing Batch Dataset Reader... Traceback (most recent call last):

File "src\UNet.py", line 355, in train_dataset_reader, validation_dataset_reader = create_BatchDatset()

File "D:\alex\Documents\Workspace py\seg\unsupervised-image-segmentation-by-WNet-with-NormalizedCut-master\src\data_io\BatchDatsetReader_VOC.py", line 109, in create_BatchDatset train_dataset = BatchDatset(data_record['training'],

File "D:\alex\Documents\Workspace py\seg\unsupervised-image-segmentation-by-WNet-with-NormalizedCut-master\src\data_io\BatchDatsetReader_VOC.py", line 127, in init self.read_data_to_self(data_records)

File "D:\alex\Documents\Workspace py\seg\unsupervised-image-segmentation-by-WNet-with-NormalizedCut-master\src\data_io\BatchDatsetReader_VOC.py", line 135, in read_data_to_self [resize_size, resize_size], interp='bilinear') for datum in data_records])

File "D:\Programmes\Anaconda\lib\site-packages\numpy\core\shape_base.py", line 349, in stack raise ValueError('need at least one array to stack') ValueError: need at least one array to stack

Would be useful to add pre-trained weights

Hi!
I was wondering whether you could upload the pre-trained weights so that we can get started with making improvements to the model from the get-go instead of training from scratch. Thanks!

Error running test script

Use standard file APIs to check for files with this prefix.
Model restored...
No files found
Traceback (most recent call last):
File "./unsupervised-image-segmentation-by-WNet-with-NormalizedCut/src/WNet_naive.py", line 190, in
test_images, preds = net.plot_segmentation_under_test_dir()
File "/content/unsupervised-image-segmentation-by-WNet-with-NormalizedCut/src/UNet.py", line 190, in plot_segmentation_under_test_dir
return test_images, test_preds
UnboundLocalError: local variable 'test_images' referenced before assignment

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.