amazon-science / siam-mot

SiamMOT: Siamese Multi-Object Tracking
Apache License 2.0
477 stars 61 forks source link

Out of date project? Unable to setup demo #57

Open alexkutsan opened 1 year ago

alexkutsan commented 1 year ago

I was trying to setup the demo locally but it does not work:

root@alex-OMEN:/opt/company/siam-mot# pip3 install -r requirements.txt
...
root@alex-OMEN:/opt/company/siam-mot# python3 demos/demo.py --demo-video ../long_video.mp4 --track-class  person_vehicel -dump-video True 
Traceback (most recent call last):
  File "demos/demo.py", line 5, in <module>
    from demos.demo_inference import DemoInference
ModuleNotFoundError: No module named 'demos'

Then I copied demo.py to the root of project and try again :

root@alex-OMEN:/opt/company/siam-mot# python3 demo.py --demo-video ../long_video.mp4 --track-class  person_vehicel -dump-video True 
Traceback (most recent call last):
  File "demo.py", line 5, in <module>
    from demos.demo_inference import DemoInference
  File "/opt/company/siam-mot/demos/demo_inference.py", line 10, in <module>
    from maskrcnn_benchmark.structures.bounding_box import BoxList
ModuleNotFoundError: No module named 'maskrcnn_benchmark'

I installed maskrcnn according to https://github.com/facebookresearch/maskrcnn-benchmark/blob/main/INSTALL.md

And the current error is :

root@alex-OMEN:/opt/company/siam-mot# python3 demo.py --demo-video ../long_video.mp4 --track-class  person_vehicel -dump-video True 
Traceback (most recent call last):
  File "demo.py", line 5, in <module>
    from demos.demo_inference import DemoInference
  File "/opt/company/siam-mot/demos/demo_inference.py", line 11, in <module>
    from maskrcnn_benchmark.utils.checkpoint import DetectronCheckpointer
  File "/usr/local/lib/python3.8/dist-packages/maskrcnn_benchmark-0.1-py3.8-linux-x86_64.egg/maskrcnn_benchmark/utils/checkpoint.py", line 7, in <module>
    from maskrcnn_benchmark.utils.model_serialization import load_state_dict
  File "/usr/local/lib/python3.8/dist-packages/maskrcnn_benchmark-0.1-py3.8-linux-x86_64.egg/maskrcnn_benchmark/utils/model_serialization.py", line 7, in <module>
    from maskrcnn_benchmark.utils.imports import import_file
  File "/usr/local/lib/python3.8/dist-packages/maskrcnn_benchmark-0.1-py3.8-linux-x86_64.egg/maskrcnn_benchmark/utils/imports.py", line 4, in <module>
    if torch._six.PY3:
AttributeError: module 'torch._six' has no attribute 'PY3'

What am I doing wrong? Is this project still actual?

KristynaJanku commented 1 year ago

The problem is that you are using a newer version of PyTorch than the one maskrcnn_benchmark was made for, which no longer has that attribute, so the Python version has to be checked differently.

When I was setting this up with PyTorch 1.10.2, I got it working by changing the _maskrcnnbenchmark/utils/import.py file like this:

Replace the original

if torch._six.PY3:

with this

import sys

if sys.version_info[0] == 3: