Giter Site home page Giter Site logo

Comments (10)

mooch443 avatar mooch443 commented on May 28, 2024

Hey,

I noticed in your TRex parameters you set output_min_frames = 4 - what happens if you set this to 0 instead? Other than that I would think that probably the automatically deduced number of individuals is wrong. Try using track_max_individuals = 0 to enable infinite detections, and then maybe set track_match_mode = approximate for testing purposes (if you have many individuals, the default method might explode, combinatorically speaking).

You might still temporarily lose some detections if individuals cross paths or become too faint or something like that. You can disable track_do_history_split to avoid some more processing. Otherwise, if you just want the segmented (and not tracked) objects with NO processing whatsoever, I'm afraid currently you would have to be experienced in C++ and do some work - the class should be fairly straight forward to use.

-Tristan

from trex.

StefanMPopp avatar StefanMPopp commented on May 28, 2024

Unfortunately, the problem persists with your suggested changes.
Is there a systematical/clever way of finding the best parameters?

Thanks for your help!
-Stefan

from trex.

mooch443 avatar mooch443 commented on May 28, 2024

As far as I understand, what you want is to save more or less "raw" object detections without tracking? And the problem, in short, is that you do not get all detections. I am not sure there is a totally built-in way of getting all segmented objects without tracking - after all, the program was designed mainly to deliver tracklets.

In general, the way I go about finding parameters is to start with a reasonable threshold (setting that up in TRex, getting visual feedback for what the threshold will do). After setting the threshold, I set blob_size_ranges to something that will include all valid objects and exclude all invalid ones. If I then have too much noise, I'll either

  • compromise on one end by increasing track_threshold too much, or ignoring small objects for example
  • I'll try to re-convert with different image processing tools enabled (such as higher threshold and enabling use_closing+closing_size)
  • try something like track_threshold_2 in case noise-objects (unlike non-noise-objects) are mainly faint-colored, e.g. waves and other reflections

-Tristan

from trex.

mooch443 avatar mooch443 commented on May 28, 2024

Maybe something like this could help: https://trex.run/docs/examples.html#create-a-short-clip-of-objects-with-or-w-o-background-after-converting-to-pv

from trex.

StefanMPopp avatar StefanMPopp commented on May 28, 2024

My main goal is to get close to 100% of possible detections, (almost) regardless of noise. I would also love to have TRex connect them to tracks, but that seemed to be part of the problem of losing detections.

For example, increasing the threshold does not lead to a monotonically increasing number of detections (or is this to be expected?). When comparing the output of two threshold values (A & B) around the peak number of detections, there are always two sets of detections (C & D) that are either in one or the other (C = in A but not B; D = in B but not A) and I have not found a parameter set yet which includes all in one output.

Thanks

  • Stefan

from trex.

mooch443 avatar mooch443 commented on May 28, 2024

There is a difference between "detections" as an object in the video, or detection that it is a valid-sized object that could be an individual. And then again, whether it will be tracked or not depends on a couple of more things (number of currently available identities, proximity, etc.). So you will likely, if you do not have set threshold too high during conversion in TGrabs, always have not segmented away all of the objects from your videos. If they are not tracked (and thus not exported), then this will be because:

  • the track_max_speed was too low, so it could not connect this object with a tracked object in the last frame
  • or the blob_size_ranges do not include the size of this objects
  • or the program expected two individuals, but can only find one (track_do_history_split)
  • or track_threshold2 is set and excludes the given object
  • track_max_individuals is set to a specific number and there are no identities left to assign (including the track_max_reassign_time)

So these are the only things you can basically do to get something tracked. With a combination of parameters above, you should be able to track all visible and moving objects at probably all times, but with possibly limited tracking quality (so you may have to pick valid frames / non-infs from the respective exported data and combine them).

This also explains why increasing threshold does not monotonically increase the number of detections, also because you are possibly thresholding some objects away - at some point detections/segementation/tracking should go down considerably. There is currently not a way to have multiple different threshold values, but you can -use_adaptive_threshold in TGrabs and a very low threshold in TRex to try and simulate that if your background is uneven. I am not sure I am understanding your setup correctly, but this should give you some pointers even if I didn't understand fully.

from trex.

tctco avatar tctco commented on May 28, 2024

Is there a GUI similar to idtracker.ai? I also find it very difficult to find good parameters (eg threshold) :(

from trex.

mooch443 avatar mooch443 commented on May 28, 2024

Of course there is a GUI. Finding a good threshold should be straight forward, if one exists - that is, if your problem is solvable by using a threshold. Don't know what your videos look like :) you do get a preview though for most things.

from trex.

tctco avatar tctco commented on May 28, 2024

My bad :( didn't see the Convert (RAW) tab...

Thx!!

from trex.

mooch443 avatar mooch443 commented on May 28, 2024

If you have suggestions, though, for how to better design the Convert tab (or the opening dialog), please let me know! This is still an area that I am working on. I myself mostly use the terminal for these tasks, so I don't have as much experience with it. :-) Any feedback appreciated!

FYI: It is in fact simply a wrapper that combines what you enter into a command-line call to tgrabs. So if you choose a threshold=25 and blob_size_ranges=[0.1,0.2] it'll generate:

tgrabs -i video.mp4 -threshold 25 -blob_size_ranges [0.1,0.2]

But I am aware that the preview is probably the most important feature and that I should focus mostly on that.

from trex.

Related Issues (20)

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.