Skip to main content

CV Training and Prediction file descriptions

  1. fastai_multi_label_v3_generic.py: This file is used to train the one-stage model and the second-stage of the two-stage model. For this script, specify the epochs, batch size, and run ID using the -e, -b, and -r parameters respectively for the localrunner.sh file. Please note that this file makes use of the frames_train table in the sqlite database to identify which frames it has to pick for training and validation.

  2. fastai_multi_label_predict.py: This file is used to run inference on test images using the trained single stage model. You need to specify the runID and model to be used using the -r and -m parameters for the localrunner.sh file. Please note that this file makes use of the frames_test table in the sqlite database to identify which frames it has to pick for training and validation.

  3. nd_vs_defect_v1_generic.py: This file is used to train the first stage of the two-stage model. The file still has references to old folders that are not used. The file also does not use the sqlite database for training and needs to be modified to use the database. I (Dhananjay) have not worked with this file extensively and don't know what parameters to pass in. Based on looking at the file, and having ran it once before you would need to pass in the -b, -e, -r, -i parameters which correspond to the batch size, number of epochs, run ID, and the training CSV file that the script uses to identify the training frames.

  4. cctv_predictions_binary_model.py: This file is used to run predictions using the first stage of the two-stage model. I (Dhananjay) have not ran this file before and don't know what parameters to pass in when running the file with localrunner.sh.

  5. cctv_predictions_filter_predicted_data.py: Do not know what this file does and what parameters / arguments it takes in.

  6. cctv_multi_label_two_stage_approach_GQC_metric.py: This file is used to get metrics for the entire two stage model. It makes use of the first stage that was generated using nd_vs_defect_v1_generic.py and the second stage that was generated using fastai_multi_label_v3_generic.py. You need to modify the STAGE1_MODEL and the STAGE2_MODEL values in settings.py.