79702187

Date: 2025-07-15 14:02:55
Score: 1
Natty:
Report link

The example you referred to is demonstrating "inference", where a pre-trained model (fasterrcnn_resnet50_fpn_v2) is used to detect objects in a single image (grace_hopper_517x606.jpg).

However, if your goal is to further train a pre-trained model using your own dataset (e.g., a folder of labeled images), this process is called transfer learning.

To do this, you would:

  1. Wrap your image dataset using a custom Dataset class (e.g., by subclassing torch.utils.data.Dataset).

  2. Pass it to a DataLoader to efficiently load batches of data.

  3. Feed the data into the model and train it using the standard PyTorch training loop.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: davidzhou