Skip to content

Commit 50e862b

Browse files
authored
Update README.md
1 parent 0816891 commit 50e862b

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,20 @@ This repo contains a few Python scripts which may be useful for those trying to
44

55
Take a look inside the `examples` directory to have an idea of the types of files that these scripts expect as input/generate as output.
66

7-
## Scripts
7+
## Usage
88

9-
The repo provides the following scripts. The output files generated by some scripts are used as input files for other scripts. Please take a look at the flowchart at the end of this page to understand in which order to use them.
9+
The repo provides a collection of scripts, which are to be called from the terminal. In order to know what arguments a particular script expects, run it with the `-h` flag to see a help message. For example: `python generate_tfrecord.py -h`. The output files generated by some scripts are used as input files for other scripts. Please take a look at [the flowchart](#script-usage-flowchart) at the end of this page to understand in which order to use them.
1010

1111
* **generate_csv.py** reads the contents of image annotations stored in [XML files](examples/raccoon-197.xml), created with [labelImg](https://github.com/tzutalin/labelImg), and generates a single [CSV file](examples/raccoon_labels.csv).
1212
* **generate_train_eval.py** reads the CSV file and separates it into train and evaluation datasets, which are also CSV files. There are options to stratify by class and to select which fraction of the input CSV will be directed to the train dataset (the rest going to evaluation).
1313
* **generate_pbtxt.py** reads the previously generated CSV file (or any CSV file that has a column named _"class"_) or a text file containing a single class name per line and no header, and generates a [label map](examples/label_map.pbtxt), one of the files needed to train a detection model using [TensorFlow's Object Detection API](https://github.com/tensorflow/models/tree/master/research/object_detection).
1414
* **generate_tfrecord.py** reads the previously generated CSV and label map files, as well as all the images from a given directory, and generates a TFRecord file, which can then be used to train an object detection model with TensorFlow. The resulting TFRecord file is about the same size of all the original images that were included in it.
1515
* **generate_yolo_txt.py** reads the CSV file and generates one .txt file for each image mentioned in the CSV file, whith the same name of the image file. These .txt files contain the object annotations for that image, in a format which [darknet](https://pjreddie.com/darknet/yolo/) uses to train its models.
1616

17-
## Usage
17+
### Script usage flowchart
1818

19-
The scripts are to be called in a terminal. In order to know what arguments a particular script expects, run it with the `-h` flag to see a help message. For example: `python generate_tfrecord.py -h`
19+
![](diagram.svg)
2020

2121
## Copyright
2222

2323
Licenses are so complicated. This work began as a fork of [Dat Tran's](http://www.dat-tran.com/) raccoon dataset repository, but then it became its own thing. Anyway, the license is unchanged and is in the repo.
24-
25-
## Script usage flowchart
26-
27-
![](diagram.svg)

0 commit comments

Comments
 (0)