1672509120
A PyTorch implementation of Single Shot MultiBox Detector from the 2016 paper by Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang, and Alexander C. Berg. The official and original Caffe code can be found here.
# First install Python server and client
pip install visdom
# Start the server (probably in a screen or tmux)
python -m visdom.server
To make things easy, we provide bash scripts to handle the dataset downloads and setup for you. We also provide simple dataset loaders that inherit torch.utils.data.Dataset
, making them fully compatible with the torchvision.datasets
API.
Microsoft COCO: Common Objects in Context
Download COCO 2014
# specify a directory for dataset to be downloaded into, else default is ~/data/
sh data/scripts/COCO2014.sh
PASCAL VOC: Visual Object Classes
Download VOC2007 trainval & test
# specify a directory for dataset to be downloaded into, else default is ~/data/
sh data/scripts/VOC2007.sh # <directory>
Download VOC2012 trainval
# specify a directory for dataset to be downloaded into, else default is ~/data/
sh data/scripts/VOC2012.sh # <directory>
ssd.pytorch/weights
dir:mkdir weights
cd weights
wget https://s3.amazonaws.com/amdegroot-models/vgg16_reducedfc.pth
train.py
as a flag or manually change them.python train.py
train.py
for options)To evaluate a trained network:
python eval.py
You can specify the parameters listed in the eval.py
file by flagging them or manually changing them.
mAP
Original | Converted weiliu89 weights | From scratch w/o data aug | From scratch w/ data aug |
---|---|---|---|
77.2 % | 77.26 % | 58.12% | 77.43 % |
FPS
GTX 1060: ~45.45 FPS
state_dicts
(dict of weight tensors) of the latest SSD model definitions trained on different datasets.If you installed PyTorch with conda (recommended), then you should already have it. (Just navigate to the ssd.pytorch cloned repo and run): jupyter notebook
If using pip:
# make sure pip is upgraded
pip3 install --upgrade pip
# install jupyter notebook
pip install jupyter
# Run this inside ssd.pytorch
jupyter notebook
demo/demo.ipynb
at http://localhost:8888 (by default) and have at it!cv2.waitkey
for optimal fps) or on an NVIDIA GPUdemo/live.py
pip install imutils
python -m demo.live
opens the webcam and begins detecting!We have accumulated the following to-do list, which we hope to complete in the near future
Note: Unfortunately, this is just a hobby of ours and not a full-time job, so we'll do our best to keep things up to date, but no guarantees. That being said, thanks to everyone for your continued help and feedback as it is really appreciated. We will try to address everything as soon as possible.
Author: Amdegroot
Source Code: https://github.com/amdegroot/ssd.pytorch
License: MIT license
#machinelearning #computervision #deeplearning #pytorch
1672509120
A PyTorch implementation of Single Shot MultiBox Detector from the 2016 paper by Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang, and Alexander C. Berg. The official and original Caffe code can be found here.
# First install Python server and client
pip install visdom
# Start the server (probably in a screen or tmux)
python -m visdom.server
To make things easy, we provide bash scripts to handle the dataset downloads and setup for you. We also provide simple dataset loaders that inherit torch.utils.data.Dataset
, making them fully compatible with the torchvision.datasets
API.
Microsoft COCO: Common Objects in Context
Download COCO 2014
# specify a directory for dataset to be downloaded into, else default is ~/data/
sh data/scripts/COCO2014.sh
PASCAL VOC: Visual Object Classes
Download VOC2007 trainval & test
# specify a directory for dataset to be downloaded into, else default is ~/data/
sh data/scripts/VOC2007.sh # <directory>
Download VOC2012 trainval
# specify a directory for dataset to be downloaded into, else default is ~/data/
sh data/scripts/VOC2012.sh # <directory>
ssd.pytorch/weights
dir:mkdir weights
cd weights
wget https://s3.amazonaws.com/amdegroot-models/vgg16_reducedfc.pth
train.py
as a flag or manually change them.python train.py
train.py
for options)To evaluate a trained network:
python eval.py
You can specify the parameters listed in the eval.py
file by flagging them or manually changing them.
mAP
Original | Converted weiliu89 weights | From scratch w/o data aug | From scratch w/ data aug |
---|---|---|---|
77.2 % | 77.26 % | 58.12% | 77.43 % |
FPS
GTX 1060: ~45.45 FPS
state_dicts
(dict of weight tensors) of the latest SSD model definitions trained on different datasets.If you installed PyTorch with conda (recommended), then you should already have it. (Just navigate to the ssd.pytorch cloned repo and run): jupyter notebook
If using pip:
# make sure pip is upgraded
pip3 install --upgrade pip
# install jupyter notebook
pip install jupyter
# Run this inside ssd.pytorch
jupyter notebook
demo/demo.ipynb
at http://localhost:8888 (by default) and have at it!cv2.waitkey
for optimal fps) or on an NVIDIA GPUdemo/live.py
pip install imutils
python -m demo.live
opens the webcam and begins detecting!We have accumulated the following to-do list, which we hope to complete in the near future
Note: Unfortunately, this is just a hobby of ours and not a full-time job, so we'll do our best to keep things up to date, but no guarantees. That being said, thanks to everyone for your continued help and feedback as it is really appreciated. We will try to address everything as soon as possible.
Author: Amdegroot
Source Code: https://github.com/amdegroot/ssd.pytorch
License: MIT license
1624271160
The Self-Driving car might still be having difficulties understanding the difference between humans and garbage can, but that does not take anything away from the amazing progress state-of-the-art object detection models have made in the last decade.
Combine that with the image processing abilities of libraries like OpenCV, it is much easier today to build a real-time object detection system prototype in hours. In this guide, I will try to show you how to develop sub-systems that go into a simple object detection application and how to put all of that together.
…
#artificial-intelligence #python #programming #implementing real-time object detection system #implementing real-time object detection system using pytorch and opencv #pytorch
1600632000
Pytorch is a Deep Learning Library Devoloped by Facebook. it can be used for various purposes such as Natural Language Processing , Computer Vision, etc
Python, Numpy, Pandas and Matplotlib
What is a tensor ?
A Tensor is a n-dimensional array of elements. In pytorch, everything is a defined as a tensor.
#pytorch #pytorch-tutorial #pytorch-course #deep-learning-course #deep-learning
1599126480
Recently, Facebook AI open-sourced a new high-speed library for training PyTorch models with differential privacy (DP) known as Opacus. The library is claimed to be more scalable than existing state-of-the-art methods.
According to the developers at the social media giant, differential privacy is a mathematically rigorous framework for quantifying the anonymisation of sensitive data. With the growing interest in the machine learning (ML) community, this framework is often used in analytics and computations.
Differential privacy constitutes a strong standard for privacy guarantees for algorithms on aggregate databases. It is usually defined in terms of the application-specific concept of adjacent databases. The framework has several properties that make it particularly useful in applications, such as group privacy, robustness to auxiliary information, among others.
#developers corner #differential privacy #facebook ai research #facebook differential privacy #opacus #pytorch #pytorch library #pytorch library opacus
1610174895
Object detection is one of the most central and critical tasks in computer vision. It is also a task with a number of practical benefits. From autonomous driving to surveillance, a well trained object detector can bring a lot of performance advantages to the table.
The recent advances in Deep Learning aided computer vision, driven primarily by the Convolutional Neural Network (CNN) architecture and more recently by the Transformer architecture have produced a number of excellent object detectors at the disposal of a computer vision practitioner. Focusing on the CNNs, a series of models of the two stage approach have been developed. These include Fast R-CNN and Faster R-CNN, two go to designs for practitioners. As the description suggests, these designs require two passes through the image: in the fast pass the network learns to formulate good regions of interest (RoI) and in the second pass the RoIs are linked to the objects to be detected.
As can be imagined, the two pass design makes these designs slower to train, and hence Single Shot Detectors (SSD) were developed that require a single pass through the image. The network performs the tasks of producing regions of interest, called anchor boxes in this design, as well as doing the object classification simultaneously in these designs. Examples of this architecture include SSD, YOLO, RetinaNet and EfficientDet. While the initial single shot detectors were not as accurate, recent revisions have greatly improved the accuracy of these designs, and their faster training times make them highly desirable for practical applications.
The performance of Deep Learning architectures often depends on carefully chosen hyper-parameters, and not surprisingly, the single shot detectors are no exception — in particular, the anchor scales and anchor ratios are prime examples of such parameters. These parameters, along with the image size and shape being used (such as 512x512 or 1024x1024 etc), determine the overall accuracy of the model being trained. Let us look deeper into how we can determine the best values of these for a task. For our example, we will work with the task of detecting helmets of NFL players in images taken at different angles. This dataset was provided as part of the recent NFL 1st and Future Kaggle Challenge. We will use EfficientDet as the model under study. Data is presented for training with compound coefficient 0 (512x512 image) and batch size 4 (due to GPU restrictions).
#pytorch #object-detection #deep-learning #machine-learning #python