noxouille / rt-mrcnn Goto Github PK
View Code? Open in Web Editor NEWReal time instance segmentation with Mask R-CNN, live from webcam feed.
Home Page: https://youtu.be/L1t8jYBwI5E
License: Other
Real time instance segmentation with Mask R-CNN, live from webcam feed.
Home Page: https://youtu.be/L1t8jYBwI5E
License: Other
Hello.
What is the big difference between the original mask-rcnn and mt-mrcnn? Are the two model structures different? How did you speed up? Is it possible to explain? Is only run_webcam.py code different?
running python run_webcam.py throws the following error.
InvalidArgumentError (see above for traceback): Incompatible shapes: [1,46,80,256] vs. [1,45,80,256]
[[node fpn_p4add/add (defined at /Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/keras/layers/merge.py:210) ]]
full output including traceback is
/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:528: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:529: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:530: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:535: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
Using TensorFlow backend.
Configurations:
BACKBONE resnet101
BACKBONE_STRIDES [4, 8, 16, 32, 64]
BATCH_SIZE 1
BBOX_STD_DEV [0.1 0.1 0.2 0.2]
COMPUTE_BACKBONE_SHAPE None
DETECTION_MAX_INSTANCES 100
DETECTION_MIN_CONFIDENCE 0.7
DETECTION_NMS_THRESHOLD 0.3
FPN_CLASSIF_FC_LAYERS_SIZE 1024
GPU_COUNT 1
GRADIENT_CLIP_NORM 5.0
IMAGES_PER_GPU 1
IMAGE_CHANNEL_COUNT 3
IMAGE_MAX_DIM 1024
IMAGE_META_SIZE 93
IMAGE_MIN_DIM 800
IMAGE_MIN_SCALE 0
IMAGE_RESIZE_MODE none
IMAGE_SHAPE [1024 1024 3]
LEARNING_MOMENTUM 0.9
LEARNING_RATE 0.001
LOSS_WEIGHTS {'rpn_class_loss': 1.0, 'rpn_bbox_loss': 1.0, 'mrcnn_class_loss': 1.0, 'mrcnn_bbox_loss': 1.0, 'mrcnn_mask_loss': 1.0}
MASK_POOL_SIZE 14
MASK_SHAPE [28, 28]
MAX_GT_INSTANCES 100
MEAN_PIXEL [123.7 116.8 103.9]
MINI_MASK_SHAPE (56, 56)
NAME coco
NUM_CLASSES 81
POOL_SIZE 7
POST_NMS_ROIS_INFERENCE 1000
POST_NMS_ROIS_TRAINING 2000
PRE_NMS_LIMIT 6000
ROI_POSITIVE_RATIO 0.33
RPN_ANCHOR_RATIOS [0.5, 1, 2]
RPN_ANCHOR_SCALES (32, 64, 128, 256, 512)
RPN_ANCHOR_STRIDE 1
RPN_BBOX_STD_DEV [0.1 0.1 0.2 0.2]
RPN_NMS_THRESHOLD 0.7
RPN_TRAIN_ANCHORS_PER_IMAGE 256
STEPS_PER_EPOCH 1000
TOP_DOWN_PYRAMID_SIZE 256
TRAIN_BN False
TRAIN_ROIS_PER_IMAGE 200
USE_MINI_MASK True
USE_RPN_ROIS True
VALIDATION_STEPS 50
WEIGHT_DECAY 0.0001
WARNING:tensorflow:From /Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
WARNING:tensorflow:From /Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:1208: calling reduce_max_v1 (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
WARNING:tensorflow:From /Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:1242: calling reduce_sum_v1 (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
WARNING:tensorflow:From /Users/<username>/Downloads/rt-mrcnn/mrcnn/model.py:772: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast instead.
2021-02-07 12:40:57.721828: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Traceback (most recent call last):
File "/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1334, in _do_call
return fn(*args)
File "/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1319, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1407, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [1,46,80,256] vs. [1,45,80,256]
[[{{node fpn_p4add/add}}]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "run_webcam.py", line 100, in <module>
results = model.detect([frame])
File "/Users/<username>/Downloads/rt-mrcnn/mrcnn/model.py", line 2524, in detect
self.keras_model.predict([molded_images, image_metas, anchors], verbose=0)
File "/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/keras/engine/training.py", line 1765, in predict
verbose=verbose, steps=steps)
File "/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/keras/engine/training.py", line 1299, in _predict_loop
batch_outs = f(ins_batch)
File "/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2352, in __call__
**self.session_kwargs)
File "/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 929, in run
run_metadata_ptr)
File "/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1152, in _run
feed_dict_tensor, options, run_metadata)
File "/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1328, in _do_run
run_metadata)
File "/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1348, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [1,46,80,256] vs. [1,45,80,256]
[[node fpn_p4add/add (defined at /Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/keras/layers/merge.py:210) ]]
Caused by op 'fpn_p4add/add', defined at:
File "run_webcam.py", line 38, in <module>
model = modellib.MaskRCNN(mode="inference", model_dir=MODEL_DIR, config=config)
File "/Users/<username>/Downloads/rt-mrcnn/mrcnn/model.py", line 1837, in __init__
self.keras_model = self.build(mode=mode, config=config)
File "/Users/<username>/Downloads/rt-mrcnn/mrcnn/model.py", line 1907, in build
KL.Conv2D(config.TOP_DOWN_PYRAMID_SIZE, (1, 1), name='fpn_c4p4')(C4)])
File "/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/keras/engine/topology.py", line 603, in __call__
output = self.call(inputs, **kwargs)
File "/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/keras/layers/merge.py", line 146, in call
return self._merge_function(inputs)
File "/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/keras/layers/merge.py", line 210, in _merge_function
output += inputs[i]
File "/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/tensorflow/python/ops/math_ops.py", line 812, in binary_op_wrapper
return func(x, y, name=name)
File "/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/tensorflow/python/ops/gen_math_ops.py", line 365, in add
"Add", x=x, y=y, name=name)
File "/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op
op_def=op_def)
File "/Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1801, in __init__
self._traceback = tf_stack.extract_stack()
InvalidArgumentError (see above for traceback): Incompatible shapes: [1,46,80,256] vs. [1,45,80,256]
[[node fpn_p4add/add (defined at /Users/<username>/miniconda3/envs/rt-mrcnn/lib/python3.6/site-packages/keras/layers/merge.py:210) ]]
How can I add the variations in the original repo already installed?
Hi, My model is trained on GPU but to run on webcam I am planning to use CPU.
How may a modify this code to enable CPU instead of GPU?
Have you had problems with the algorithm running incredibly slow? Do you know if there are any ways to make the computations easier other than decreasing the image size? Thanks in advance!
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.