Social-Evolution-and-Behavior / anTraX

anTraX: high throughput tracking of color-tagged insects
https://antrax.readthedocs.io/
GNU General Public License v3.0
17 stars 3 forks source link

Extract Trainset Responding Slow #34

Open lizimai opened 2 years ago

lizimai commented 2 years ago

Hi! I encounter the slow response issue when I am using the graphic tool of anTrax: Extract Trainset.

  1. When I try to change between images in antrax, the software start to respond really slow (> 30s) after the 50th image.
  2. When I try to switch between movies via the "Tracklets" option in the top bar menu, the process of "Preparaing validation datset, loading images..." takes around 5-10 mins.

The first issue was also observed in a different higher memory machine. However, I don't know if the second issue is due to the low memory on my machine.

Thanks a lot!


Information of my machine: MacBook Pro 2017, Processor 2.3 GHZ Dual Core Intel Core i5 Memory 8 GB 2133 MHz LPDDR3 MacOS Catalina 10.15.7 Matlab 2020a Python 3.7.10

asafgal commented 2 years ago

Hey Zimai,

By default, the software preloads the images from 50 tracklets when the GUI opens. After that, it will load the images only when you ask for a new tracklet, hence the delay (although 30sec is too much I must say). The cli does not allow you to change this setting, but you can launch the gui from the matlab prompt with:

validate_classifications(<path-to-expdir>, 'N', <num-of-tracklets-to-preload>);

Obviously, the price you pay is a delay in opening the GUI. You can also choose a specific video range to draw tracklets from, or that are classifies with a specific ID (if you are doing a second round training):

validate_classifications(<path-to-expdir>, 'N', <num-of-tracklets-to-preload>, 'movlist', <list-of-video-inices>, 'id', <ID>);

This is not related to your machine, but to inefficiencies in the way anTraX (via MATLAB) stores and access tracklet data.

Let me know if it helps!

lizimai commented 2 years ago

Thanks a lot Asaf! However, I think the bigger problem is the point 2 that I listed: the loading process when switching between videos in extract-tracklet takes >10 mins and thus it takes very long for me to build a transet. I am not sure if this can be improved by the machine?

asafgal commented 2 years ago

Can you give me some info about your experiment / data? How many videos you have, how many colonies/ants in the frame. how long is each video, whats the order of magnitude of the number of tracklets per video? The delay in loading a file can be a result of a very fragmented dataset (a file containing very large number of short tracklets).