augmentedstartups / mask-rcnn Goto Github PK
View Code? Open in Web Editor NEWVideo Tutorial Series on Mask RCNN
Video Tutorial Series on Mask RCNN
I cannot output the masks using vis_util.visualize_boxes_and_labels_on_image_array.
It seems that the size of the masks is different from the size of the image
this is the error :
ValueError: The image has spatial dimensions (480, 640) but the mask has dimensions (15, 15)
here is my code.. please correct it.
while(True):
ret, frame = video.read()
frame_expanded = np.expand_dims(frame, axis=0)
(masks, boxes, scores, classes, num) = sess.run([detection_masks,
detection_boxes,
detection_scores,
detection_classes,
num_detections],
feed_dict={image_tensor: frame_expanded})
masks = np.squeeze(masks).astype(np.uint8)
vis_util.visualize_boxes_and_labels_on_image_array(
frame,
np.squeeze(boxes),
np.squeeze(classes).astype(np.int32),
np.squeeze(scores),
category_index,
instance_masks=masks,
use_normalized_coordinates=True,
line_thickness=2)
cv2.imshow('Object detector', frame)
if cv2.waitKey(1) == ord('q'):
break
Hi AS,
Nice tutorial. Plan to enroll to your courses soon!
Problem : When i run -
python video_demo.py Video.mp4
i get
unable to fetch frame
Is there a problem with the .mp4 format or need to alter the code?
when I try to create an environment with the mask_rcnn.yml file, it returns me the following output:
Solving environment: failed
ResolvePackageNotFound:
- wincertstore==0.2=py36h7fe50ca_0
- freetype==2.9.1=ha9979f8_1
- mkl==2019.3=203
- winpty==0.4.3=4
- pywavelets==1.0.2=py36h8c2d366_0
- icc_rt==2019.0.0=h0cc432a_1
- msys2-conda-epoch==20160418=1
- xz==5.2.4=h2fa13f4_4
- sqlite==3.27.2=he774522_0
- openssl==1.1.1b=hfa6e2cd_2
- libtiff==4.0.10=hb898794_2
- pyzmq==18.0.0=py36ha925a31_0
- jpeg==9b=hb83a4c4_2
- zeromq==4.3.1=h33f27b4_3
- geos==3.7.1=h33f27b4_0
- cytoolz==0.9.0.1=py36hfa6e2cd_1
- h5py==2.8.0=py36hf7173ca_2
- pywinpty==0.5.5=py36_1000
- tensorflow==1.13.1=mkl_py36hd212fbe_0
- tensorboard==1.13.1=py36h33f27b4_0
- tk==8.6.8=hfa6e2cd_0
- qt==5.9.7=vc14h73c81de_0
- scipy==1.2.1=py36h29ff71c_0
- pyyaml==5.1=py36he774522_0
- mkl_random==1.0.2=py36h343c172_0
- nbformat==4.4.0=py36h3a5bc1b_0
- mock==2.0.0=py36h9086845_0
- python==3.6.8=h9f7ef89_7
- mkl_fft==1.0.10=py36h14836fe_0
- libopencv==3.4.2=h20b85fd_0
- wcwidth==0.1.7=py36h3d5aa90_0
- libsodium==1.0.16=h9d3ae62_0
- py-opencv==3.4.2=py36hc319ecb_0
- m2w64-gcc-libs-core==5.3.0=7
- m2w64-libwinpthread-git==5.0.0.4634.697f757=2
- kiwisolver==1.0.1=py36h6538335_0
- markupsafe==1.1.1=py36he774522_0
- matplotlib==3.0.3=py36hc8f65d3_0
- cython==0.29.6=py36h6538335_0
- yaml==0.1.7=hc54c509_2
- libprotobuf==3.6.1=h7bd577a_0
- m2w64-gcc-libgfortran==5.3.0=6
- scikit-image==0.14.2=py36ha925a31_0
- sip==4.19.8=py36h6538335_0
- numpy-base==1.16.2=py36hc3f5095_0
- traitlets==4.3.2=py36h096827d_0
- shapely==1.6.4=py36h222a598_0
- icu==58.2=ha66f8fd_1
- libpng==1.6.36=h2a8f88b_0
- vc==14.1=h0510ff6_4
- intel-openmp==2019.3=203
- tensorflow-base==1.13.1=mkl_py36hcaf7020_0
- vs2015_runtime==14.15.26706=h3a45250_0
- protobuf==3.6.1=py36h33f27b4_0
- mistune==0.8.4=py36he774522_0
- pyreadline==2.1=py36_1
- hdf5==1.8.20=hac2f561_1
- zlib==1.2.11=h62dcd97_3
- grpcio==1.16.1=py36h351948d_1
- zstd==1.3.7=h508b16e_0
- cycler==0.10.0=py36h009560c_0
- ipython_genutils==0.2.0=py36h3c5d0ee_0
- m2w64-gcc-libs==5.3.0=7
- pyrsistent==0.14.11=py36he774522_0
- tornado==6.0.1=py36he774522_0
- pillow==5.4.1=py36hdc69c19_0
- pyqt==5.9.2=py36h6538335_2
- m2w64-gmp==6.1.0=2
- numpy==1.16.2=py36h19fb1c0_0
So I cloned my environment that I think has the necessary packages for computer vision tasks.
conda create -n mask_rcnn --clone vision
When I try to install the requirements.txt file I receive the following output:
pip install -r requirments.txt
Collecting imgaug==0.2.8
Using cached imgaug-0.2.8-py2.py3-none-any.whl (682 kB)
Collecting pycocotools
Cloning https://github.com/philferriere/cocoapi.git to /tmp/pip-install-b7hf_d2a/pycocotools
Running command git clone -q https://github.com/philferriere/cocoapi.git /tmp/pip-install-b7hf_d2a/pycocotools
ERROR: Command errored out with exit status 1:
command: /home/mateus/anaconda3/envs/mask_rcnn/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-b7hf_d2a/pycocotools/PythonAPI/setup.py'"'"'; __file__='"'"'/tmp/pip-install-b7hf_d2a/pycocotools/PythonAPI/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-b7hf_d2a/pycocotools/PythonAPI/pip-egg-info
cwd: /tmp/pip-install-b7hf_d2a/pycocotools/PythonAPI
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-b7hf_d2a/pycocotools/PythonAPI/setup.py", line 2, in <module>
from Cython.Build import cythonize
ModuleNotFoundError: No module named 'Cython'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
and
pip3 install -r requirments.txt
Collecting imgaug==0.2.8 (from -r requirments.txt (line 1))
Cache entry deserialization failed, entry ignored
Using cached https://files.pythonhosted.org/packages/f2/e3/4e19b465d6662e841e2960d77aa187414315b463302142a001a389cdaf2a/imgaug-0.2.8-py2.py3-none-any.whl
Collecting pycocotools from git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI (from -r requirments.txt (line 2))
Cloning https://github.com/philferriere/cocoapi.git to /tmp/pip-build-3d647ior/pycocotools
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-3d647ior/pycocotools/PythonAPI/setup.py", line 2, in <module>
from Cython.Build import cythonize
ModuleNotFoundError: No module named 'Cython'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-3d647ior/pycocotools/PythonAPI
I am on Ubuntu 18.04.4 LTS x86_64 with:
CPU: Intel i7-7700HQ (8) @ 3.800GHz
GPU: NVIDIA GeForce GTX 1060 Mobile
GPU: Intel Integrated Graphics
How do you run visualize_cv.py? from command promp? or in jupyter
Basically tried everything under the sun to get visualiaze_cv2.py to run... but i always get this error
AttributeError: module 'tensorflow' has no attribute 'log'
I was hoping to get this to run correctly with installing the yam_file with setting up an anaconda env, however, this was not the case, still the same error
Hello ,
I get error when i tried to training balloon dataset from the first epoch ,
My laptop freeze and it back works just after rebooting
UserWarning: Using a generator with
use_multiprocessing=True
and multiple workers may duplicate your data. Please consider using the`keras.utils.Sequence class.
When i change use_multiprocessing=False and works=1 , the error appears again
How can i solve this error?
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.