<jupyter_start><jupyter_text>Installation - Run these commands          - git clone https://github.com/Tessellate-Imaging/Monk_Object_Detection.git          - cd Monk_Object_Detection/6_cornernet_lite/installation      - Select the right requirements file and run      - chmod +x install.sh     - ./install.sh  About the network1. Paper on CornerNet: https://arxiv.org/abs/1808.012442. Paper on CornerNet-Lite: https://arxiv.org/abs/1904.089003. Blog 1 on CornerNet: https://joshua19881228.github.io/2019-01-20-CornerNet/4. Blog 2 on CornerNet: https://zhangtemplar.github.io/anchor-free-detection/5. Blog 3 on CornerNet: https://opencv.org/latest-trends-of-object-detection-from-cornernet-to-centernet-explained-part-i-cornernet/6. Blog 4 on CornerNet: https://towardsdatascience.com/centernet-keypoint-triplets-for-object-detection-review-a314a8e4d4b07. Blog 5 on CornerNet: https://medium.com/@andersasac/the-end-of-anchors-improving-object-detection-models-and-annotations-73828c7b39f6  COCO Format - 1 Dataset Directory Structure    ../sample_dataset (root_dir)          |          |------ship (coco_dir)           |         |          |         |----images (img_dir)          |                |          |                |------Train (set_dir) (Train)          |                         |          |                         |---------img1.jpg          |                         |---------img2.jpg          |                         |---------..........(and so on)          |          |          |         |---annotations           |         |----|          |              |--------------------instances_Train.json  (instances_.json)          |              |--------------------classes.txt                     - instances_Train.json -> In proper COCO format - classes.txt          -> A list of classes in alphabetical order For TrainSet - root_dir = "../sample_dataset"; - coco_dir = "ship"; - img_dir = "images"; - set_dir = "Train";  Note: Annotation file name too coincides against the set_dir  COCO Format - 2 Dataset Directory Structure    ../sample_dataset (root_dir)          |          |------ship (coco_dir)           |         |          |         |---ImagesTrain (set_dir)          |         |----|          |              |-------------------img1.jpg          |              |-------------------img2.jpg          |              |-------------------.........(and so on)          |          |          |         |---annotations           |         |----|          |              |--------------------instances_ImagesTrain.json  (instances_.json)          |              |--------------------classes.txt                     - instances_Train.json -> In proper COCO format - classes.txt          -> A list of classes in alphabetical order  For TrainSet - root_dir = "../sample_dataset"; - coco_dir = "ship"; - img_dir = "./"; - set_dir = "ImagesTrain";  Note: Annotation file name too coincides against the set_dir   Sample Dataset Credits    credits: https://github.com/experiencor/kangaroo<jupyter_code>import os
import sys
sys.path.append("../../6_cornernet_lite/lib/")
from train_detector import Detector
gtf = Detector();
root_dir = "../sample_dataset";
coco_dir = "kangaroo"
img_dir = "/"
set_dir = "Images"
gtf.Train_Dataset(root_dir, coco_dir, img_dir, set_dir, batch_size=4, use_gpu=True, num_workers=4)
gtf.Model(model_name="CornerNet_Saccade")
gtf.Hyper_Params(lr=0.00025, total_iterations=1000)
gtf.Setup();
gtf.Train();<jupyter_output>start_iter       = 0
distributed      = False
world_size       = 0
initialize       = False
batch_size       = 4
learning_rate    = 0.00025
max_iteration    = 1000
stepsize         = 800
snapshot         = 500
val_iter         = 500
display          = 100
decay_rate       = 10
Process 0: building model...
total parameters: 116847521
start prefetching data...
start prefetching data...
start prefetching data...
shuffling indices...
shuffling indices...
shuffling indices...
start prefetching data...
shuffling indices...
setting learning rate to: 0.00025
training start...
Process 0: training loss at iteration 100: 5.4285078048706055                   
 15%|█████▉                                  | 148/1000 [02:09<12:28,  1.14it/s]shuffling indices...
 15%|█████▉                                  | 149/1000 [02:10<12:27,  1.14it/s]shuffling indices...
 15%|██████                                  | 150/1000 [02:11<12:30,  1.13it/s]shuffling indices...
 16%|██████▏                             [...]<jupyter_text>Inference<jupyter_code>import os
import sys
sys.path.append("../../6_cornernet_lite/lib/")
from infer_detector import Infer
gtf = Infer();
class_list = ["kangaroo"]
gtf.Model(class_list, 
          base="CornerNet_Saccade", 
          model_path="./cache/nnet/CornerNet_Saccade/CornerNet_Saccade_final.pkl")
boxes = gtf.Predict("../sample_dataset/kangaroo/test/kg1.jpeg", vis_thresh=0.3, output_img="output.jpg")
from IPython.display import Image
Image(filename='output.jpg')
boxes = gtf.Predict("../sample_dataset/kangaroo/test/kg4.jpeg", vis_thresh=0.15, output_img="output.jpg")
from IPython.display import Image
Image(filename='output.jpg')
boxes = gtf.Predict("../sample_dataset/kangaroo/test/kg3.jpeg", vis_thresh=0.3, output_img="output.jpg")
from IPython.display import Image
Image(filename='output.jpg')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15912079654330266, 'fraction_numerical': 0.04114221303776066, 'mean_word_length': 1.8934782608695653, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, 'https://': 9, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '145736', 'license': 'Apache-2.0', 'n_tokens_mistral': 1807, 'n_tokens_neox': 1584, 'n_words': 322, 'path': 'example_notebooks/6_cornernet_lite/Train CornerNet-Saccade.ipynb', 'repo_name': 'jayeshk7/Monk_Object_Detection', 'size': '5323'}