azzhu / EasyFlyTracker

MIT License
11 stars 8 forks source link

easyFlyTracker command not executing #7

Closed peregrin-nook closed 1 year ago

peregrin-nook commented 1 year ago

When I attempt to run the easyFlyTracker command (I am on Windows 11 using VSCodium), it responds with the message, "easyFlyTracker : The term 'easyFlyTracker' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

And when I attempt to run it using "py -m easyFlyTracker" it respond with "No module named easyFlyTracker.main; 'easyFlyTracker' is a package and cannot be directly executed". Please help!

azzhu commented 1 year ago

hi, update easyFlyTracker to new version(0.12.2) :

pip install --upgrade -i https://pypi.org/simple/ easyFlyTracker

then you can use this method to run easyFlyTracker:

python -m easyFlyTracker [config_path]      # Corresponding terminal command: easyFlyTracker [config_path]
python -m easyFlyTracker -a [config_path]   # Corresponding terminal command: easyFlyTracker_analysis [config_path]
python -m easyFlyTracker -c [config_path]   # Corresponding terminal command: easyFlyTracker_cam_calibration [config_path]

thanks. good luck.

peregrin-nook commented 1 year ago

Thank you, it works well! However, I have one more problem. After tracking the flies, I am unable to use "easyFlyTracker_analysis", and I get the message "no module named easyFlyTracker_analysis". Do I need to download easyFlyTracker_analysis separately? I can't find it in my designated folder for packages.

azzhu commented 1 year ago

if you want use "easyFlyTracker_analysis", you can:

python -m easyFlyTracker -a [config_path]

notice: "easyFlyTracker", but not "easyflytracker"

peregrin-nook commented 1 year ago

Thank you! :)

peregrin-nook commented 1 year ago

I was all done tracking my data, but when I finally analyzed it, I got this message:

Group name: CTRL-M
Group ids : [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
...Done
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\users\meli8\appdata\local\programs\python\python311\lib\site-packages\easyFlyTracker\__main__.py", line 40, in <module>
    easyFlyTracker_analysis(params)
  File "C:\users\meli8\appdata\local\programs\python\python311\lib\site-packages\easyFlyTracker\cli.py", line 53, in easyFlyTracker_analysis
    one_step_run(params)
  File "C:\users\meli8\appdata\local\programs\python\python311\lib\site-packages\easyFlyTracker\src_code\show.py", line 583, in one_step_run
  File "C:\users\meli8\appdata\local\programs\python\python311\lib\site-packages\easyFlyTracker\src_code\show.py", line 374, in show_all

    self.SHOW_heatmap_barycenter()
  File "C:\users\meli8\appdata\local\programs\python\python311\lib\site-packages\easyFlyTracker\src_code\show.py", line 242, in SHOW_heatmap_barycenter
    self.ana.PARAM_heatmap_barycenter(p, p_heatmap)
  File "C:\users\meli8\appdata\local\programs\python\python311\lib\site-packages\easyFlyTracker\src_code\analysis.py", line 417, in PARAM_heatmap_barycenter
    cv2.circle(img, tuple(cp), int(round(dist)), (255, 255, 0), -1, cv2.LINE_AA)
                                   ^^^^^^^^^^^
ValueError: cannot convert float NaN to integer

What does this mean? I could analyze the demo files perfectly fine, but when analyzing my own files, which I had already tracked, I could not analyze them. Is there a solution to this problem?

azzhu commented 1 year ago

can you share your video file, config file and group file to me? I test it in my computer.

peregrin-nook commented 1 year ago

Sure, this is the link. I included the config.pkl file, as well. https://drive.google.com/drive/folders/13yIa48j8shN0Naso3ra4wOiGqJeIZ89m?usp=share_link

azzhu commented 1 year ago

Hi, I find two problems:

1, the "config.bmp" image in output path is incorrect, the circle is not drawn on the roi. which means the subsequent tracking is wrong. I suggest you double check that this step is configured correctly. image

2, the fruit flies in the video do not move. the software cannot detect stationary objects. stationary objects are filtered out as background. the image in "output_path/.cache/background_image.bmp" proves it.

peregrin-nook commented 1 year ago

Thank you for the notice, I'll have to deal with these problems. I should be fine after resolving the problems, so thank you!