vicariousinc / science_rcn Goto Github PK
View Code? Open in Web Editor NEWReference implementation of a two-level RCN model
Home Page: https://www.vicarious.com/Common_Sense_Cortex_and_CAPTCHA.html
License: MIT License
Reference implementation of a two-level RCN model
Home Page: https://www.vicarious.com/Common_Sense_Cortex_and_CAPTCHA.html
License: MIT License
Should I expect to have better than CNN accuracy when using larger datasets?
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.
After training a model, what command should I use to recognize some image I have
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:
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
.
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
We used the following commond:
python science_rcn/run.py --train_size 20 --test_size 20 --parallel
Thanks
(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'
Does anyone has any idea how to solve this?
Does the published code not include the implementation of dictionary learning necessary for learning intermediate features? Why is the published code very limited and doesn't include everything in the paper?
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
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?
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
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.
It's more general and complicated than mnist.
https://github.com/zalandoresearch/fashion-mnist
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.
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 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
(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
(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
This issue was automatically created by Allstar.
Security Policy Violation
No protection found for branch master
This issue will auto resolve when the policy is in compliance.
Issue created by Allstar. See https://github.com/ossf/allstar/ for more information. For questions specific to the repository, please contact the owner or maintainer.
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?
With occlusions (by us)
With noise (by us)
could you share your code?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.