Giter Club home page Giter Club logo

m2det's People

Contributors

tadax 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

m2det's Issues

another question when evluating

I insert the code :" parser.add_argument('--num_boxes', type=int, default=196560) # (128x128+64x64+32x32+16x16+8x8+4x4)x9=196560
parser.add_argument('--shapes', type=int, nargs='+', default=[128, 64, 32, 16, 8, 4]) # for 1024x1024" in the evalution.py,

the used the command:
python evaluate.py --image_dir trace_damge_detect_dataset/JPEGImages/ --label_dir mscoco/labels/ --model_path weights/checkpoint

but, I meet the problem:
DataLossError (see above for traceback): Unable to open table file weights/checkpoint: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]
[[Node: save/RestoreV2/_301 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_306_save/RestoreV2", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]]

please help me ,thanks! please~!

when running evaluate.py, there is something wrong

I run the command:
python evaluate.py --image_dir trace_damge_detect_dataset/JPEGImages --label_dir trace_damge_detect_dataset/annotations/ --model_path weights/variables

but the problem is :
100%|███████████████████████████████████████████████████████████████████████████| 7610/7610 [00:00<00:00, 74069.06it/s]
data size: 0

/home/yh/.conda/envs/yh/lib/python3.6/site-packages/numpy/core/fromnumeric.py:2957: RuntimeWarning: Mean of empty slice.
out=out, **kwargs)
/home/yh/.conda/envs/yh/lib/python3.6/site-packages/numpy/core/_methods.py:80: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
[email protected]: nan

about assign_boxes(boxes, priors, num_classes, threshold=0.5):

def assign_boxes(boxes, priors, num_classes, threshold=0.5):
num_classes += 1 # add background class
assignment = np.zeros((len(priors), 4 + num_classes + 1))
assignment[:, 4] = 1.0 # background
encoded_boxes = np.apply_along_axis(encode_box, 1, boxes[:, :4], priors, threshold)
encoded_boxes = encoded_boxes.reshape(-1, len(priors), 5)
best_iou = encoded_boxes[:, :, -1].max(axis=0)
best_iou_idx = encoded_boxes[:, :, -1].argmax(axis=0)

I think the axis should be 1 , not 0. it that right? why?

best_iou_mask = best_iou > 0 # judge by iou between prior and bbox
best_iou_idx = best_iou_idx[best_iou_mask]
assign_num = len(best_iou_idx)
encoded_boxes = encoded_boxes[:, best_iou_mask, :]
assignment[:, :4][best_iou_mask] = encoded_boxes[best_iou_idx, np.arange(assign_num), :4]
assignment[:, 4][best_iou_mask] = 0 # background
assignment[:, 5:-1][best_iou_mask] = boxes[best_iou_idx, 4:]
assignment[:, -1][best_iou_mask] = 1 # objectness

return assignment

some diffs

for code about SFAM as bellowing, seems fc1 is sigmoid and fc2 is relu, while the order in author' code is inverse?

        with tf.variable_scope('SFAM'):
            for i in range(self.scales):
                feature = tf.concat([outs[j][i] for j in range(self.levels)], axis=3)
                attention = tf.reduce_mean(feature, axis=[1, 2], keepdims=True)
                attention = tf.layers.dense(inputs=feature, units=64, 
                                            activation=tf.nn.sigmoid, name='fc1_{}'.format(i+1))
                attention = tf.layers.dense(inputs=attention, units=1024,
                                            activation=tf.nn.relu, name='fc2_{}'.format(i+1))
                feature = feature * attention
                features.insert(0, feature)

Original purpose of unnecessary code line.

Hi, while reading your code, I found unnecessary line in m2det.py.
(Commint ID: f0decfe)

In m2det.py line 52.

attention = tf.reduce_mean(feature, axis=[1, 2], keepdims=True)
attention = tf.layers.dense(inputs=feature, units=64, 
                            activation=tf.nn.sigmoid, name='fc1_{}'.format(i+1))
attention = tf.layers.dense(inputs=attention, units=1024,
                            activation=tf.nn.relu, name='fc2_{}'.format(i+1))

Line 52 have no meaning because attention is re-assigned in line 53 before using it.
As I understand it, reduce_mean is for averaging pooling.
It seems to be same with line in below link(which is from author's implementation with pytorch).
https://github.com/qijiezhao/M2Det/blob/579c0f7b46b9b0a5bd301e92823c4ab115cfaccc/layers/senet.py#L98
So, Should line 53 be modified like below?

attention = tf.reduce_mean(feature, axis=[1, 2], keepdims=True)
attention = tf.layers.dense(inputs=attention, units=64, 
                            activation=tf.nn.sigmoid, name='fc1_{}'.format(i+1))
attention = tf.layers.dense(inputs=attention, units=1024,
                            activation=tf.nn.relu, name='fc2_{}'.format(i+1))

I can't set input size to 1024

i meet the problem, when I set --input_size 1024 and --num_boxes 196560,
in the train progress , it has the error : can't send the size [? 196560,20] to [8,19251,20],

I find all files to locate the 19251, but I can't find it

please help me, thanks!

please help me about the problem?

I run the command as: python demo.py --inputs fatigue_block_37.jpg
and modifed the demo.py about the lines:

parser.add_argument('--input_size', type=int, default=1024)
parser.add_argument('--num_classes', type=int, default=14)

Traceback (most recent call last):
File "demo.py", line 56, in
main(parser.parse_args())
File "demo.py", line 41, in main
results = det.detect(img)
File "/data/yh/proj/m2det/utils/detector.py", line 74, in detect
boxes = self.decode_boxes(outs[:, :4])
File "/data/yh/proj/m2det/utils/detector.py", line 37, in decode_boxes
decode_bbox_center_x = boxes[:, 0] * 0.1 * prior_width # variance0
ValueError: operands could not be broadcast together with shapes (196560,) (19215,)

What does "num_priors" mean?

Hi, while reading yours code, I don't understand the mean of "num_priors".
Can you tell me the answer?
Thank you

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.