├── README.md ├── build_dataset.py ├── config ├── __pycache__ │ ├── __init__.cpython-36.pyc │ ├── __init__.cpython-37.pyc │ ├── terrorist_detection_retinanet_config.cpython-36.pyc │ └── terrorist_detection_retinanet_config.cpython-37.pyc └── custom_dataset_config.py ├── dataset ├── annotations │ ├── 1.xml │ ├── 2.xml │ └── 3.xml ├── image_resizer.py └── images │ ├── 1.jpg │ └── 2.jpg ├── keras_retinanet ├── __init__.py ├── backend │ ├── __init__.py │ └── backend.py ├── bin │ ├── __init__.py │ ├── convert_model.py │ ├── debug.py │ ├── evaluate.py │ └── train.py ├── callbacks │ ├── __init__.py │ ├── coco.py │ ├── common.py │ └── eval.py ├── initializers.py ├── layers │ ├── __init__.py │ ├── _misc.py │ └── filter_detections.py ├── losses.py ├── models │ ├── __init__.py │ ├── densenet.py │ ├── effnet.py │ ├── mobilenet.py │ ├── resnet.py │ ├── retinanet.py │ ├── senet.py │ └── vgg.py ├── preprocessing │ ├── __init__.py │ ├── coco.py │ ├── csv_generator.py │ ├── generator.py │ ├── kitti.py │ ├── open_images.py │ └── pascal_voc.py └── utils │ ├── __init__.py │ ├── anchors.py │ ├── coco_eval.py │ ├── colors.py │ ├── compute_overlap.pyx │ ├── config.py │ ├── eval.py │ ├── gpu.py │ ├── image.py │ ├── model.py │ ├── tf_version.py │ ├── transform.py │ └── visualization.py ├── people_detection_image.py ├── people_detection_video.py ├── requirements.txt ├── setup.cfg ├── setup.py ├── snapshots └── snapshot2.txt ├── tensorboard └── events.out.tfevents.1569443836.DESKTOP-OFDT6FL └── tests ├── __init__.py ├── backend ├── __init__.py └── test_common.py ├── bin └── test_train.py ├── layers ├── __init__.py ├── test_filter_detections.py └── test_misc.py ├── models ├── __init__.py ├── test_densenet.py └── test_mobilenet.py ├── preprocessing ├── __init__.py ├── test_csv_generator.py ├── test_generator.py └── test_image.py ├── requirements.txt ├── test_losses.py └── utils ├── __init__.py ├── test_anchors.py └── test_transform.py /README.md: -------------------------------------------------------------------------------- 1 | # Keras-retinanet-Training-on-custom-datasets-for-Object-Detection- 2 | 3 | ## Prerequisites 4 | 1. Clone this repository. 5 | 2. Ensure numpy is installed using pip install numpy --user 6 | 3. In the repository, execute pip install . --user. Note that due to inconsistencies with how tensorflow should be installed, this package does not define a dependency on tensorflow as it will try to install that (which at least on Arch Linux results in an incorrect installation). Please make sure tensorflow is installed as per your systems requirements. 7 | 4. Alternatively, you can run the code directly from the cloned repository, however you need to run python setup.py build_ext --inplace to compile Cython code first. 8 | 5. Optionally, install pycocotools if you want to train / test on the MS COCO dataset by running pip install --user git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI. 9 | 10 | Note : Make sure that tensorflow is installed on the machine (tensorflow version < 2.0) 11 | ,python <=3.7 12 | 13 | ## Prepare Data for training 14 | 1. Clone or download this repository. 15 | 2. Delete files inside snapshot,tensorboard,dataset/annotation and dataset/images in this directory. 16 | 3. Paste all training images in dataset/images directory. 17 | 4. Next step is to create annotation file for each images and place all annotation xml files in dataset/annotations 18 | directory. Which will be in xml format. LabelImg is one of the tool which can be used for annotation. 19 | [LabelImg github](https://github.com/tzutalin/labelImg) or [LabelImg exe](https://tzutalin.github.io/labelImg/) 20 | 5. Then have to set the config file custom_dataset_config.py inside config directory. 21 | Here set the path for annotation, image, train.csv files and also set the path where the classes.csv have to be 22 | saved. TRAIN_TEST_SPLIT value will split the data for training and testing. 23 | 6. create train.csv, test.csv and classes.csv by using build_dataset.py inside this directory. 24 | Run the following command inside the directory 25 | 26 | `python build_dataset.py` 27 | 28 | The datas inside train.csv and test.csv will be in the following format. 29 | 30 | `,,,,,