MendelXu / ANN

semantic segmentation,pytorch,non-local
Apache License 2.0
312 stars 63 forks source link

Can this model be used for human segmentation? #7

Closed andrewwyl closed 4 years ago

andrewwyl commented 4 years ago

@MendelXu thanks for this great work, Can this model be used for human segmentation?for example :hair ,face and so on

thanks

MendelXu commented 4 years ago

Thanks for your attention. I am not familiar with human segmentation, but I think relation extraction should all make sense for this problem. In my perspective, the human segmentation problem may also need spatial relations like "face always is the neighbor of hair while the leg is not," which might not be extracted adequately by this work.

andrewwyl commented 4 years ago

thanks for you reply ,when i test your code,i meet this quetion,can you tell me why? File "/root/.pycharm_helpers/pydev/pydevd.py", line 1741, in main() File "/root/.pycharm_helpers/pydev/pydevd.py", line 1735, in main globals = debugger.run(setup['file'], None, None, is_module) File "/root/.pycharm_helpers/pydev/pydevd.py", line 1135, in run pydev_imports.execfile(file, globals, locals) # execute the script File "/root/.pycharm_helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/home/data/andrew/ANN-master/main_val.py", line 201, in Controller.test(runner) File "/home/data/andrew/ANN-master/methods/tools/controller.py", line 78, in test runner.test(test_dir, out_dir) File "/home/data/andrew/ANN-master/methods/seg/fcn_segmentor_test.py", line 48, in test total_logits = self.ss_test(data_dict) File "/home/data/andrew/ANN-master/methods/seg/fcn_segmentor_test.py", line 88, in ss_test results = self._predict(data_dict) File "/home/data/andrew/ANN-master/methods/seg/fcn_segmentor_test.py", line 213, in _predict results = self.seg_net.forward(data_dict['img']) File "/home/data/venv/torch1x_tf1x/lib/python3.5/site-packages/torch/nn/parallel/data_parallel.py", line 152, in forward outputs = self.parallel_apply(replicas, inputs, kwargs) File "/home/data/venv/torch1x_tf1x/lib/python3.5/site-packages/torch/nn/parallel/data_parallel.py", line 162, in parallel_apply return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)]) File "/home/data/venv/torch1x_tf1x/lib/python3.5/site-packages/torch/nn/parallel/parallel_apply.py", line 36, in parallel_apply assert len(modules) == len(inputs) AssertionError

MendelXu commented 4 years ago

The number of gpu may not be equal to batch size. Please change the batch_size to the number of gpu you have. https://github.com/MendelXu/ANN/blob/f4eabeb27dbba5c9bdcf83d03776bffa34995666/hypes/seg/cityscapes/fs_annn_cityscapes_seg.json#L66

andrewwyl commented 4 years ago

thank you very much, i change it ,and it run now,