GithubHelp home page GithubHelp logo

joker316701882 / salient-object-detection Goto Github PK

View Code? Open in Web Editor NEW
440.0 20.0 139.0 4.02 MB

This is tensorflow implementation for cvpr2017 paper "Deeply Supervised Salient Object Detection with Short Connections"

Python 100.00%
computervision saliency-detection deeplearning

salient-object-detection's Introduction

Salient-Object-Detection

This is tensorflow implementation for cvpr2017 paper "Deeply Supervised Salient Object Detection with Short Connections"

Pretrained Model

https://drive.google.com/drive/folders/0B6l9O8aWij8fUGtVNldUTXA4eHc?resourcekey=0-h1RonqWwyH-Z0jgRLVC4mQ&usp=sharing

Usage

1. Download pretrained model and put them under folder "salience_model" ,(need to create folder yourself)
2. run code

If you want to test whole folder images, run this:

python inference.py --rgb_folder=[your folder]

sample:

python inference.py --rgb_folder=./test

If you want to test only one image,run this:

python inference.py --rgb=[your image]

sample:

python inference.py --rgb=animal1.jpg

Sample

Sample

more detail please read source code.

salient-object-detection's People

Contributors

joker316701882 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

salient-object-detection's Issues

what is your version of tensorflow

I have encounted the errror
No OpKernel was registered to support Op 'MaxPoolWithArgmax' with these attrs
and don't know how to solver that

Error running code.

When I tried running this code I got this error.

D:\Salient_Object_Detection>python inference.py --rgb_folder=./test
Traceback (most recent call last):
File "inference.py", line 65, in
main(parse_arguments(sys.argv[1:]))
File "inference.py", line 19, in main
gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction = args.gpu_fraction)
AttributeError: module 'tensorflow' has no attribute 'GPUOptions'

Can you help me?

source code

Hope the author can release the training code ,Thanks!

CRF

Hi! Thank you for your work! Does 'inference.py' contain CRF?

ValueError: Can't load save_path when it is None.

你好,我已经安装readme建立文件夹,也下载了训练模型放在里面,但是运行时报这个错,想请教一下怎么解决,谢谢您!

hello,I have this erro“ValueError: Can't load save_path when it is None.”,when runing your code ,but I have already download the pre-train model and put them in salient_model ,just as the readme.txt, please give me a suggestion ,thank you every much!

`rgba2rgb(img)` is not working as wanted

def rgba2rgb(img):
    return img[:,:,:3]*np.expand_dims(img[:,:,3],2)

This function does not remove the alpha channel but multiplies RGB channel with the alpha channel in np.uint8 range. This seems a bug.

pretrained model

The pretrained model is unable to use.
'''
发生异常: NotFoundError
Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

./salience_model/model.ckpt-200.data-00000-of-00001; No such file or directory
[[node save/RestoreV2_18 (defined at mnt/wwei/Salient_object_detection/Salient-Object-Detection-master/inference.py:21) ]]

Batch test

Thanks for your sharing! This model works well.
However, the released model can only process one image at one time, it is very time consuming if I have a large number of images. Hope the author can release the training code or help make the batch_size as None in placeholder.
Thanks!

code for training

Can I take a look at how you wrote your model in tensorflow? What kind of archrecture you are using for implementing the paper and the public datasets available to train the model on?

Unable to test on single image

I tried to run on top of an image as python inference.py --rgb=Chris.jpg...

im getting the following error,

Traceback (most recent call last):
  File "/Users/anaconda/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1139, in _do_call
    return fn(*args)
  File "/Users/anaconda/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1117, in _run_fn
    self._extend_graph()
  File "/Users/anaconda/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1166, in _extend_graph
    self._session, graph_def.SerializeToString(), status)
  File "/Users/anaconda/lib/python3.6/contextlib.py", line 89, in __exit__
    next(self.gen)
  File "/Users/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status
    pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: No OpKernel was registered to support Op 'MaxPoolWithArgmax' with these attrs.  Registered devices: [CPU], Registered kernels:
  <no registered kernels>

	 [[Node: pool1 = MaxPoolWithArgmax[T=DT_FLOAT, Targmax=DT_INT64, ksize=[1, 2, 2, 1], padding="SAME", strides=[1, 2, 2, 1]](conv1_2)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "inference.py", line 65, in <module>
    main(parse_arguments(sys.argv[1:]))
  File "inference.py", line 22, in main
    saver.restore(sess,tf.train.latest_checkpoint('./salience_model'))
  File "/Users/anaconda/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1548, in restore
    {self.saver_def.filename_tensor_name: save_path})
  File "/Users/anaconda/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 789, in run
    run_metadata_ptr)
  File "/Users/anaconda/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 997, in _run
    feed_dict_string, options, run_metadata)
  File "/Users/anaconda/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1132, in _do_run
    target_list, options, run_metadata)
  File "/Users/anaconda/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1152, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: No OpKernel was registered to support Op 'MaxPoolWithArgmax' with these attrs.  Registered devices: [CPU], Registered kernels:
  <no registered kernels>

	 [[Node: pool1 = MaxPoolWithArgmax[T=DT_FLOAT, Targmax=DT_INT64, ksize=[1, 2, 2, 1], padding="SAME", strides=[1, 2, 2, 1]](conv1_2)]]

Caused by op 'pool1', defined at:
  File "inference.py", line 65, in <module>
    main(parse_arguments(sys.argv[1:]))
  File "inference.py", line 21, in main
    saver = tf.train.import_meta_graph('./meta_graph/my-model.meta')
  File "/Users/anaconda/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1686, in import_meta_graph
    **kwargs)
  File "/Users/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/meta_graph.py", line 504, in import_scoped_meta_graph
    producer_op_list=producer_op_list)
  File "/Users/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 311, in import_graph_def
    op_def=op_def)
  File "/Users/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2506, in create_op
    original_op=self._default_original_op, op_def=op_def)
  File "/Users/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1269, in __init__
    self._traceback = _extract_stack()

InvalidArgumentError (see above for traceback): No OpKernel was registered to support Op 'MaxPoolWithArgmax' with these attrs.  Registered devices: [CPU], Registered kernels:
  <no registered kernels>

	 [[Node: pool1 = MaxPoolWithArgmax[T=DT_FLOAT, Targmax=DT_INT64, ksize=[1, 2, 2, 1], padding="SAME", strides=[1, 2, 2, 1]](conv1_2)]]

Missing License file

Hi @Joker316701882 , we love the work that you have done and that you posted it as open-source, can you also add a license file to the repository that states the open-source license the project should have? MIT would be great.

Thanks!

Keras?

Hello! First , thank your for this amazing work !, will it be possible to make it a keras model?? I really need to use this model but on a keras and not tensor flow if possible ;p
Thanks a lot

model

can you open source the model?

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.