Git Product home page Git Product logo

science_rcn's People

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

science_rcn's Issues

Did anyone had work on solving recaptcha data set?

currently I am working on recaptcha data set , while working on the project , it only takes the 2 images for testing while there is huge amount of data is available. I tried converting RGBA image to grey-scale using cv2 lib, padding, resizing the image.

Recognizing an Image

After training a model, what command should I use to recognize some image I have

OSError: [Errno 12] Cannot allocate memory

When I use my own dataset to train RCN, an exception occures, the error information as follow:

The command:
python2.7 science_rcn/run_onechar.py --train_size 31000 --test_size 3100 --parallel --pool_shape 25 --perturb_factor 2.0

ERROR INFO:
NFO:main:Training on 31000 images...
INFO:main:Testing on 3100 images...
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib64/python2.7/threading.py", line 812, in __bootstrap_inner
self.run()
File "/usr/lib64/python2.7/threading.py", line 765, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/lib64/python2.7/multiprocessing/pool.py", line 325, in _handle_workers
pool._maintain_pool()
File "/usr/lib64/python2.7/multiprocessing/pool.py", line 229, in _maintain_pool
self._repopulate_pool()
File "/usr/lib64/python2.7/multiprocessing/pool.py", line 222, in _repopulate_pool
w.start()
File "/usr/lib64/python2.7/multiprocessing/process.py", line 130, in start
self._popen = Popen(self)
File "/usr/lib64/python2.7/multiprocessing/forking.py", line 121, in init
self.pid = os.fork()
OSError: [Errno 12] Cannot allocate memory

anyone have a working version of this in Python 3.7?

1st of all this is an awesome repo.

Update: I have it working on Python 3.7 for science_rcn/run.py but had to make a few specific code design change to achieve the Total test accuracy = 0.7.

There were a few changes you had to make to update the code to Python 3.7. Unrelated to updating the code from Python 2.7 to Python 3.7 are the following design changes:

1 important change is in preproc.py fwd_infer(...) function I had to change

localized[localized < 1] = 0

to

localized[localized < background_threshold] = 0 & added a background_threshold=.001 function argument to fwd_infer(...)

I also changed max_cxn_length=100 in add_underconstraint_edges(...) to max_lateral_connection_pixel_length=15 to create graphs that looked like the following:

label=0_num_landmark_features=80_num_close_pairs=420_perturb_factor=2 0_max_lateral_connection_pixel_length=15_tolerance=4

NOTE: changing max_cxn_length=100 to max_cxn_length=15 did not effect the Total test accuracy = 0.7.

If you do this & rerun science_rcn/run.py with 10 train & test images instead of the default 20 you also get Total test accuracy = 0.7.

Occluded and Noisy MNIST dataset

Hi, I am trying to replicate this paper. However, the occluded and noisy MNIST dataset that is linked in the Vicarious blog is not available anymore. Can anyone share it again?

Thank you.

Regards

How to train using Yahoo or reCaptcha?

I tried to using the program to train using Yahoo's data provided in your blog, but failed to print the following error message:

INFO:main:Training on 124 images...
INFO:main:Testing on 0 images...
Traceback (most recent call last):
File "science_rcn/run.py", line 230, in
parallel=options.parallel)
File "science_rcn/run.py", line 95, in run_experiment
print "Total test accuracy = {}".format(float(correct) / len(test_results))
ZeroDivisionError: float division by zero

We used the following commond:
python science_rcn/run.py --train_size 20 --test_size 20 --parallel

Thanks

'Graph' object has no attribute 'edge'

(python2) douzp@gpu75:~/science_rcn/science_rcn$ python run.py
INFO:main:Training on 20 images...
Traceback (most recent call last):
File "run.py", line 230, in
parallel=options.parallel)
File "run.py", line 83, in run_experiment
train_results = pool.map_async(train_partial, [d[0] for d in train_data]).get(9999999)
File "/home/douzp/anaconda3/envs/python2/lib/python2.7/multiprocessing/pool.py", line 572, in get
raise self._value
AttributeError: 'Graph' object has no attribute 'edge'

IndexError: too many indices for array

The program works with the provied MNIST data, but failed when trained with other data, printing the following message:

INFO:main:Training on 20 images...
Traceback (most recent call last):
File "science_rcn/run.py", line 230, in
parallel=options.parallel)
File "science_rcn/run.py", line 83, in run_experiment
train_results = pool.map_async(train_partial, [d[0] for d in train_data]).get(9999999)
File "D:\Anaconda\envs\py27\lib\multiprocessing\pool.py", line 572, in get
raise self._value
IndexError: too many indices for array

Does anyone has any idea how to solve this?

not able to setup on python2.7

Anyone successfully setup on ubuntu 16.04?
After creating a virtual environment by
$ virtualenv -p python2.7 venv
activate it and run
$ python setup install
The python 2.7 setup gives error:
...site-packages/setuptools/sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-EL_eGV/numpy-1.17.2/setup.py", line 31, in
pass
RuntimeError: Python version >= 3.5 required.

Any suggestions to resolve this would be appreciated.

Best,
Dong

Can't install: make: *** [dependencies] Error 1

I have been having trouble downloading this. I have tried using make to download it in Python 2.7.10, but it doesn't seem to work. I uploaded the doc of the full output because it's so long. The main red colored errors are the following:

  ERROR: Failed building wheel for science-rcn
  ERROR: Failed building wheel for pillow
  ERROR: Failed building wheel for scipy
  ERROR: Failed cleaning build dir for scipy
  ERROR: Command errored out with exit status 1: /Users/Smile/science_rcn/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/gv/nk7s8r7968q_htrwn9jvhl000000gq/T/pip-install-z8kkf4hf/numpy/setup.py'"'"'; __file__='"'"'/private/var/folders/gv/nk7s8r7968q_htrwn9jvhl000000gq/T/pip-install-z8kkf4hf/numpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/gv/nk7s8r7968q_htrwn9jvhl000000gq/T/pip-record-szu1uyz5/install-record.txt --single-version-externally-managed --compile --install-headers /Users/Smile/science_rcn/venv/include/site/python3.8/numpy Check the logs for full command output.

Full Output Doccument:
Error.docx

I have also tried doing the manual installation with Python 2.7.10, but it gives me the error: RuntimeError: Python version >= 3.6 required.

So then I tried downloading it with python 3.8 and I get the following error:

running install
running bdist_egg
running egg_info
writing science_rcn.egg-info/PKG-INFO
writing dependency_links to science_rcn.egg-info/dependency_links.txt
writing requirements to science_rcn.egg-info/requires.txt
writing top-level names to science_rcn.egg-info/top_level.txt
reading manifest file 'science_rcn.egg-info/SOURCES.txt'
writing manifest file 'science_rcn.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.9-x86_64/egg
running install_lib
running build_py
running build_ext
building '_dilation' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -I/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/include -c science_rcn/dilation/dilation.cc -o build/temp.macosx-10.9-x86_64-3.8/science_rcn/dilation/dilation.o
In file included from science_rcn/dilation/dilation.cc:4:
In file included from /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
In file included from /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: 
      "Using deprecated NumPy API, disable it with "          "#define
      NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it with " \
 ^
science_rcn/dilation/dilation.cc:30:12: error: use of undeclared identifier
      'Py_InitModule'
    (void) Py_InitModule("_dilation", dilationmethods);
           ^
science_rcn/dilation/dilation.cc:31:5: error: void function 'init_dilation'
      should not return a value [-Wreturn-type]
    import_array(); // Must be present for NumPy.  Called first after ab...
    ^~~~~~~~~~~~~~
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/include/numpy/__multiarray_api.h:1531:144: note: 
      expanded from macro 'import_array'
  ..."numpy.core.multiarray failed to import"); return NULL; } }
                                                ^      ~~~~
1 warning and 2 errors generated.
error: command 'gcc' failed with exit status 1

Any ideas how to fix this?

Problem when using the code in win10

Hi, I am really excited about your work. I am currently doing my own research. However, I am facing a problem now, when I run it on my windows10 device it show something like below
s
It seems to me that is not the problem of the system but the problem of the code itself.
Hope you can give me a way to fix this and I will be really appreciated.

Does the demo has shape only preprocessing layer in inference?

As mentioned in section 4.2.1 of the supplementary material: The preprocessing layer.

An even simpler option is to use a preprocessing stage that discards the appearance consistency information. Such preprocessing stage only needs to perform edge detection at multiple rotations (without considering for each rotation the three di↵erent orientations described in Fig. S2) and produces only a small performance degradation in practice. Any edge detection algorithm such as Gabor filtering can produce satisfactory results.

Fail to reproduce results

The experiments fails to achieve the announced accuracy:

python science_rcn/run.py --train_size 100 --test_size 20 --parallel
INFO:__main__:Training on 10 images...
INFO:__main__:Testing on 20 images...
Total test accuracy = 0.1

There is a java version

There is some version in java, because I am a Java developer and I am interested in your project because I consider it very good. I have no knowledge of python so I ask if there is any version of the software in java. Thank you for your attention

ImportError: No module named _dilation

(caffe) wmdeMacBook-Pro:science_rcn-master wm$ python science_rcn/run.py
Traceback (most recent call last):
File "science_rcn/run.py", line 27, in
from inference import test_image
File "/Users/wm/workspace/RCN/science_rcn-master/science_rcn/inference.py", line 15, in
from dilation.dilation import dilate_2d
File "/Users/wm/workspace/RCN/science_rcn-master/science_rcn/dilation/dilation.py", line 4, in
from _dilation import max_filter1d, brute_max_filter1d
ImportError: No module named _dilation

ImportError: No module named _dilation

(caffe) wmdeMacBook-Pro:science_rcn-master wm$ python science_rcn/run.py
Traceback (most recent call last):
File "science_rcn/run.py", line 27, in
from inference import test_image
File "/Users/wm/workspace/RCN/science_rcn-master/science_rcn/inference.py", line 15, in
from dilation.dilation import dilate_2d
File "/Users/wm/workspace/RCN/science_rcn-master/science_rcn/dilation/dilation.py", line 4, in
from _dilation import max_filter1d, brute_max_filter1d
ImportError: No module named _dilation

fatal error C1083: Cannot open include file: 'stdbool.h': No such file or directory

OS: Windows 10

While using Anaconda prompt, i created a new environment with

create -n rcn python=2.7

Then I try the install:

python setup.py install

Finally get the following error:
...
building '_dilation' extension

C:\Users\Pinilla\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\ProgramData\Anaconda3\envs\rcn_test1\include -IC:\ProgramData\Anaconda3\envs\rcn_test1\PC "-Ie:\downloads hdd\uned papers\rey-osterrieth\science_rcn-master\.eggs\numpy-1.16.6-py2.7-win-amd64.egg\numpy\core\include" /Tpscience_rcn/dilation/dilation.cc /Fobuild\temp.win-amd64-2.7\Release\science_rcn/dilation/dilation.obj

dilation.cc

e:\downloads hdd\uned papers\rey-osterrieth\science_rcn-master\.eggs\numpy-1.16.6-py2.7-win-amd64.egg\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION

science_rcn/dilation/dilation.cc(8) : fatal error C1083: Cannot open include file: 'stdbool.h': No such file or directory

error: command 'C:\\Users\\Pinilla\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

Tried installing latest version of Visual Studio and the MSVC por python as the setup.py suggests.

Any ideas?

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.