Practical overview
When it fits
Use it when you need a configurable PyTorch SSD workflow and can work within its documented model and hardware limits.
Who it is for
- Developers building SSD object-detection workflows in PyTorch.
- Practitioners training or evaluating detectors on VOC-format datasets.
- Developers who want single-machine, multi-GPU training or video detection examples.
Documented uses
- Train an SSD model on a VOC-format dataset.
- Evaluate a model and calculate AP and mAP.
- Run object detection on an image or video, with options to display or save video results.
- Visualize training progress with Visdom.
Requirements & limits
The public GitHub repository identifies the project as open source under the Apache-2.0 license.
- Training and evaluation require GPU hardware; CPU and multi-machine training or evaluation are not supported.
- Training data is currently limited to VOC format.
- The documented dependencies include PyTorch, opencv-python, torchvision 0.3.0 or later, Vizer, and Visdom.
- SSD512 has a VGG base network in the repository, but the README says its corresponding configuration file is not included.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Train SSD on a single machine with one or more GPUs
Configure the SSD training components and pass a model and dataset to the trainer.
Before you start
- PyTorch, OpenCV-Python, torchvision 0.3.0 or later, Vizer, and visdom.
- A dataset in VOC format.
- A single-machine GPU setup; CPU training and multi-machine multi-GPU training are not supported.
- Visdom installed and running to visualize training.
Steps
Install and start visdom with the command below and the command below, then open
127.0.0.1:8097for training visualization.pip install visdompython -m visdom.serverConfigure training parameters in the Configs files, including the dataset root and GPU device settings; alternatively, GPU devices can be specified through the trainer's
train_devicesparameter.Create
net = SSD(cfg)and move it tocfg.DEVICE.MAINDEVICEwithnet.to(cfg.DEVICE.MAINDEVICE).Initialize
trainer = Trainer(cfg, ...)and start training by callingtrainer(net, train_dataset).
Expected outcome
The trainer runs the model on the supplied dataset, with training visualization through visdom.
Guide limitations
- Training supports single-machine, single-GPU or single-machine, multi-GPU setups; it does not support multi-machine multi-GPU or CPU training.
- The documented dataset format is VOC.
- The guide does not specify dataset preparation steps.
Detect objects in a single image with SSD
Load an SSD model and weights, then run single-image detection.
Before you start
- PyTorch, OpenCV-Python, torchvision 0.3.0 or later, and Vizer.
- A model configuration and the pretrained weights file
Weights/pretrained/vgg_ssd300_voc0712.pkl. - A single image to detect.
Steps
Create the model with
net = SSD(cfg)and select a device withnet.to('cuda'); the README states single-image detection supports CPU or GPU depending on the model's runtime environment.Load the weights with
net.load_pretrained_weight('Weights/pretrained/vgg_ssd300_voc0712.pkl').Open an image with
Image.open(...)and callnet.Detect_single_img(image=image, score_threshold=0.5).Use the returned drawn image, boxes, labels, and scores; the README example displays the drawn image with matplotlib.
Expected outcome
The detection call returns an image with detection boxes drawn, along with boxes, labels, and scores.
Guide limitations
- The README's device example uses CUDA, while noting that single-image detection supports CPU or GPU depending on the runtime environment.
- The listed weight path must be available for the documented example.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 15 November 2026
- Original website title
- yatengLG/SSD-Pytorch · Official homepage title · retained in its source language

