keypoint-detection icon indicating copy to clipboard operation
keypoint-detection copied to clipboard

Coco dataset , fix for grayscales images, convert them to RGB

Open ExtReMLapin opened this issue 7 months ago • 5 comments

ExtReMLapin avatar May 15 '25 08:05 ExtReMLapin

@ExtReMLapin thanks for your contribution, looks like a useful addition! I'll merge it soon.

tlpss avatar May 15 '25 13:05 tlpss

🖖🏻

A pleasure. I also have more changes in staging for annother PR which adds max_image_size param I'm training it on forensic images that have different resolutions and often high ones which causes :

  1. OOM during training (because of big resolution)
  2. Error during validation because of torch.stack trying to stack up different sizes.

ExtReMLapin avatar May 15 '25 14:05 ExtReMLapin

Hi @ExtReMLapin

Sounds like an interesting project.

I consider these steps part of the preprocessing to reduce the burden on the ML codebase (can't support everything in the training loops) and to increase data loading speeds (loading a huge image from disk and then resizing it can bottleneck the GPU because it has to wait on the CPU, which is not desirable).

I will probably not accept a PR that does image resizing in the dataloader (as a separation of concerns).

You should consider resizing the images upfront into a separate dataset and only then training a detector on them.

I have some code for this here if you are interested.

tlpss avatar May 15 '25 14:05 tlpss

@ExtReMLapin can you take a look at the CI failures? apparently one of the tests was broken by an update in torch ,but the fix should be straightforward.

Btw, I'm on a conference next week so will take some time for me to get back to you! But I do appreciate the PRs :slightly_smiling_face:

tlpss avatar May 16 '25 15:05 tlpss

No worry with the delay.

To be frank i've been working on this forensic minutiae detector for two years and you have no idea how sometimes it's a pain in the ass to :

  • set up the whole repository env
  • transform your dataset
  • discover their undocumented training examples are not working

here it's just working with wandb integration, few issues with DDP but it's fine tbf

ExtReMLapin avatar May 16 '25 16:05 ExtReMLapin