vye16 / slahmr

MIT License
441 stars 50 forks source link

Solution to omit frames where there are no people? It is causing 0 Batch size issue #38

Closed smandava98 closed 11 months ago

smandava98 commented 11 months ago

Hi, I am running SLAHMR on a video where for the first couple seconds there is no person in the video (person shows up later).

I saw the PHALP results and confirmed they work fine. However, the run_opt.py fails with the below error:

saved 1 keyframes to /home/ubuntu/slahmr/slahmr/cameras/testVid1/shot-0 FOUND 9/1453 FRAMES FOR SHOT 0 USING TOTAL 9 888x1920 IMGS TRACK LENGTHS [] [0] TRACK IDS [] START 0 END 0 SAVED TRACK INFO Error executing job with overrides: ['data=video', 'run_opt=True', 'run_vis=True'] Traceback (most recent call last): File "/home/ubuntu/slahmr/slahmr/run_opt.py", line 144, in main run_opt(cfg, dataset, out_dir, device) File "/home/ubuntu/slahmr/slahmr/run_opt.py", line 53, in run_opt loader = DataLoader(dataset, batch_size=B, shuffle=False) File "/home/ubuntu/mambaforge/envs/slahmr/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 350, in init batch_sampler = BatchSampler(sampler, batch_size, drop_last) File "/home/ubuntu/mambaforge/envs/slahmr/lib/python3.10/site-packages/torch/utils/data/sampler.py", line 232, in init raise ValueError("batch_size should be a positive integer value, " ValueError: batch_size should be a positive integer value, but got batch_size=0

Is there a way to automatically slice the parts of the video where no people are detected and fix this issue?

smandava98 commented 11 months ago

In video.yaml, I have the start_idx as 0 and the end_idx a very high number (10000) because I want to run SLAHMR on the full video of my video dataset. My suspicion is it might be tied to this. However, I only encounter this issue when there are frames with no people at the beginning.. The dataset used is the MultiPerson dataset.

Futhermore, I see a similar concern was voiced here: https://github.com/vye16/slahmr/issues/25#issuecomment-1632093939

but the solution there was to change shot_idx which seems to be a manual fix. I am looking for a more automatic fix since the intro and outro of some videos might not contain people.

smandava98 commented 11 months ago

Resolved