This repository implements the code for Repulsion Loss: Detecting pedestrians in a crowd. This page(code, project and presentation) is the submission for Group B for final project for the course CS 256: Topics in Artificial Intelligence, Section 2 led by Prof. Mashhour Soul, PhD. The group members include:
The code maybe used for educational and commercial use under no warranties.
For questions on this project and code please reach out to: Vidish Naik at vidish.naik@sjsu.edu
- PyTorch: 0.4.0
- TorchVision: 0.2.0
- CUDA: 8.0
Clone this repository
git clone https://github.com/VidishNaik/RepulsionLoss.gitcd into the folder
cd RepulsionLossExport the path for CUDA:
export CUDA_HOME="/usr/local/cuda-8.0"
export LD_LIBRARY_PATH="/usr/local/cuda-8.0/lib64":$LD_LIBRARY_PATH
export PATH="/usr/local/cuda-8.0/bin:$PATH"Verify that CUDA is indeed set to CUDA8
nvcc -Vnvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2016 NVIDIA Corporation Built on Tue_Jan_10_13:22:03_CST_2017 Cuda compilation tools, release 8.0, V8.0.61
Install the requirements
pip install -r requirements.txtRun the startup.sh script
sh startup.shThis will compile the required libraries in the lib folder and also download PASCAL VOC dataset in the dataset folder as well as download a pre-trained model in data/pretrained_model directory.
NOTE: The libraries in the current state are compiled for Nvidia Tesla K80 GPU. Change the CUDA_ARCH argument in lib/make.sh if you're using a different GPU. Refer this link for the correct architecture for your GPU. You can also refer the CUDA WIKI to get the correct architecture.
python trainval_net.py --dataset pascal_voc --net vgg16 --bs 4 --nw 1 --cuda- Keep batch size (bs) < 4 on a Tesla K80 GPU as it will run out of memory
- Currently only works for
vgg16. Future updates might include resnet101. - dataset can be changed to pascal_voc_0712 for PASCAL VOC 2012
For testing the model download the pre-trained weights and store it in models/vgg16/pascal_voc/faster_rcnn_1_10_2504.pth
python test_net.py --net vgg16 --checksession 1 --checkepoch 10 --checkpoint 2504 --cudaStore the images that you need to run in the images folder. New images with detections will be stored in the same folder
python demo.py --cuda --load_dir models --net vgg16 --checksession 1 --checkepoch 10 --checkpoint 2504This project was conducted with free credits provided by AWS educate team.