$ pip install -r requirements.txt
>>> from strided_inference.strided_inference import strided_inference
>>> img_name = 'img.jpg'
>>> image = cv2.imread(f'images/{img_name}')
>>> detections = strided_inference(img, img_name, detector, tile_size_info=(900, 700, 701), nms_th=0.95)
The key use case of this module is to make use of Strided Inferencing with a pre-trained model, yet for lot of cases there might be a need to train a new model on tiled images. We provide a submodule that performs this task and outputs tiled images and new tiled CSV(containing annotations) for your new model training.
>>> from tiler_with_annotations import tile_for_training
>>> ob = tile_for_training()
>>> ob.tiler_with_annotations(image_folder_path, annotation_csv_path, output_directory_path, tile_size_information)
We ran OpenCV's DNN module's object detection using our library to see the difference in the result. Please re-run the code in Trying_strided_inference.ipynb to get similar results. The model has to be downloaded from this link and put inside example/OpenCV DNN
folder before running the notebook.
Below we can see results of using OpenCV’s DNN module’s ssd_mobilenet network object detection with and without strided inference:
This code base is partially based on a brilliant paper published in CVF. We sincerely would like to thank Unel, Ozkalaycı and Cıgla for their work.
-
@amit_amola is the current maintainer of the code and has written much of the current code base, including a complete refactor of the core for open source version. He has been part of Bridgei2i since 2018 and currently works as Senior Analytics Consultant at AI Labs.
-
Anil Prasad MN Google Scholar, LinkedIn, Github
The project was carried under supervision and guidance of @anilprasadmn. He currently works as Manager AI labs at BRIDGEi2i Analytics Solutions.
If someone has any queries, one can connect to us via email- [email protected]
Feel free to contribute to the project and raise pull request for the same.