{"id":15636994,"url":"https://github.com/chunml/ssd-tf2","last_synced_at":"2025-08-21T20:32:00.810Z","repository":{"id":39739953,"uuid":"212473894","full_name":"ChunML/ssd-tf2","owner":"ChunML","description":"A super clean implementation of SSD (Single Shot MultiBox Detector) made possible by Tensorflow 2.0","archived":false,"fork":false,"pushed_at":"2022-12-08T06:40:00.000Z","size":24,"stargazers_count":115,"open_issues_count":18,"forks_count":54,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-12-10T21:24:51.445Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChunML.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-03T01:16:13.000Z","updated_at":"2024-01-19T08:53:58.000Z","dependencies_parsed_at":"2023-01-24T18:18:23.354Z","dependency_job_id":null,"html_url":"https://github.com/ChunML/ssd-tf2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChunML%2Fssd-tf2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChunML%2Fssd-tf2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChunML%2Fssd-tf2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChunML%2Fssd-tf2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChunML","download_url":"https://codeload.github.com/ChunML/ssd-tf2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230532443,"owners_count":18240792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T11:09:30.512Z","updated_at":"2024-12-20T04:06:57.533Z","avatar_url":"https://github.com/ChunML.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SSD (Single Shot MultiBox Detector) - Tensorflow 2.0\n\n## Preparation\n- Download PASCAL VOC dataset (2007 or 2012) and extract at `./data`\n- Install necessary dependencies:\n```\npip install -r requirements.txt\n```\n\n## Training\nArguments for the training script:\n\n```\n\u003e\u003e python train.py --help\nusage: train.py [-h] [--data-dir DATA_DIR] [--data-year DATA_YEAR]\n                [--arch ARCH] [--batch-size BATCH_SIZE]\n                [--num-batches NUM_BATCHES] [--neg-ratio NEG_RATIO]\n                [--initial-lr INITIAL_LR] [--momentum MOMENTUM]\n                [--weight-decay WEIGHT_DECAY] [--num-epochs NUM_EPOCHS]\n                [--checkpoint-dir CHECKPOINT_DIR]\n                [--pretrained-type PRETRAINED_TYPE] [--gpu-id GPU_ID]\n```\nArguments explanation:\n-  `--data-dir` dataset directory (must specify to VOCdevkit folder)\n-  `--data-year` the year of the dataset (2007 or 2012)\n-  `--arch` SSD network architecture (ssd300 or ssd512)\n-  `--batch-size` training batch size\n-  `--num-batches` number of batches to train (`-1`: train all)\n-  `--neg-ratio` ratio used in hard negative mining when computing loss\n-  `--initial-lr` initial learning rate\n-  `--momentum` momentum value for SGD\n-  `--weight-decay` weight decay value for SGD\n-  `--num-epochs` number of epochs to train\n-  `--checkpoint-dir` checkpoint directory\n-  `--pretrained-type` pretrained weight type (`base`: using pretrained VGG backbone, other options: see testing section)\n-  `--gpu-id` GPU ID\n\n- how to train SSD300 using PASCAL VOC2007 for 100 epochs:\n\n```\npython train.py --data-dir ./data/VOCdevkit --data-year 2007 --num-epochs 100\n```\n\n- how to train SSD512 using PASCAL VOC2012 for 120 epochs on GPU 1 with batch size 8 and save weights to `./checkpoints_512`:\n\n```\npython train.py --data-dir ./data/VOCdevkit --data-year 2012 --arch ssd512 --num-epochs 120 --batch-size 8 --checkpoint_dir ./checkpoints_512 --gpu-id 1\n```\n\n## Testing\nArguments for the testing script:\n```\n\u003e\u003e python test.py --help\nusage: test.py [-h] [--data-dir DATA_DIR] [--data-year DATA_YEAR]\n               [--arch ARCH] [--num-examples NUM_EXAMPLES]\n               [--pretrained-type PRETRAINED_TYPE]\n               [--checkpoint-dir CHECKPOINT_DIR]\n               [--checkpoint-path CHECKPOINT_PATH] [--gpu-id GPU_ID]\n```\nArguments explanation:\n-  `--data-dir` dataset directory (must specify to VOCdevkit folder)\n-  `--data-year` the year of the dataset (2007 or 2012)\n-  `--arch` SSD network architecture (ssd300 or ssd512)\n-  `--num-examples` number of examples to test (`-1`: test all)\n-  `--checkpoint-dir` checkpoint directory\n-  `--checkpoint-path` path to a specific checkpoint\n-  `--pretrained-type` pretrained weight type (`latest`: automatically look for newest checkpoint in `checkpoint_dir`, `specified`: use the checkpoint specified in `checkpoint_path`)\n-  `--gpu-id` GPU ID\n\n- how to test the first training pattern above using the latest checkpoint:\n\n```\npython test.py --data-dir ./data/VOCdevkit --data-year 2007 --checkpoint_dir ./checkpoints\n```\n\n- how to test the second training pattern above using the 100th epoch's checkpoint, using only 40 examples:\n\n```\npython test.py --data-dir ./data/VOCdevkit --data-year 2012 --arch ssd512 --checkpoint_path ./checkpoints_512/ssd_epoch_100.h5 --num-examples 40\n```\n\n## Reference\n- Single Shot Multibox Detector paper: [paper](https://arxiv.org/abs/1512.02325)\n- Caffe original implementation: [code](https://github.com/weiliu89/caffe/tree/ssd)\n- Pytorch implementation: [code] (https://github.com/ChunML/ssd-pytorch)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchunml%2Fssd-tf2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchunml%2Fssd-tf2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchunml%2Fssd-tf2/lists"}