Team Leader Email - sudb97@gmail.com
Description: This project is part of the Intel OneAPI Hackathon 2023, under the object detection and Segmentation for Autonomous Vehicle theme by Team Momentum.We embarked on a project to develop a robust object detection and segmentation model capable of handling complex scenarios like bad weather and low light conditions. For the task at hand we have implemented Hybridnets model, which is an end2end perception network for multi-tasks. Our work focused on traffic object detection, drivable area segmentation and lane detection. HybridNets can run real-time on embedded systems, and obtains SOTA Object Detection, Lane Detection on BDD100K Dataset. The model is trained on image input which will be temporal in nature. Further training is done using HybridNet neural network Architecture with the intel's oneDNN pytorch optimization to perform faster inferencing. Finally the real time inference will be achieved using the intel's oneDNN libraries which will provide mainly three outputs that are, object bounding box, object class and lane detection.
Technologies used to Build the prototype Intelยฎ AI Analytics Toolkits, and it's libraries
HybridNets
โ backbone.py # Model configuration
โ export.py # UPDATED 10/2022: onnx weight with accompanying .npy anchors
โ hubconf.py # Pytorch Hub entrypoint
โ hybridnets_test_images_old.py # Image inference
โ hybridnets_test_images.py # Modified hybridnets_test to get inference time for a no of images
โ hybridnets_test_videos_old.py # Video inference
โ hybridnets_test_videos.py # Modified hybridnets_test_videos to get inference for different length of videos
โ speedup_test.py # Calculate
โ train.py # Train script
โ train_ddp.py # DistributedDataParallel training (Multi GPUs)
โ val.py # Validate script
โ val_ddp.py # DistributedDataParralel validating (Multi GPUs)
โ frameCount_vs_time_plot.py # Plot framecount vs time taken to infer
โ imageCount_vs_time_plot.py # Plot imagecount vs time taken to infer
โ speedup_test.py # Speedup test for comparison between with and without optimization
โ
โโโโdemo # Images and videos for testing inference
โ
โโโโdemo_results # Post processing results on test images and videos to validate the inference
โ
โโโโdata # Time record for inferences on different conditions
โ
โโโโplots # Comparison plots between inferences on different conditions
โ
โโโโencoders # https://github.com/qubvel/segmentation_models.pytorch/tree/master/segmentation_models_pytorch/encoders
โ ...
โ
โโโโhybridnets
โ autoanchor.py # Generate new anchors by k-means
โ dataset.py # BDD100K dataset
โ loss.py # Focal, tversky (dice)
โ model.py # Model blocks
โ
โโโโprojects
โ bdd100k.yml # Project configuration
โ
โโโโutils
โ constants.py
โ plot.py # Draw bounding box
โ smp_metrics.py # https://github.com/qubvel/segmentation_models.pytorch/blob/master/segmentation_models_pytorch/metrics/functional.py
โ utils.py # Various helper functions (preprocess, postprocess, eval...)
The project was developed with Python>=3.7 and Pytorch>=1.10.
# Creating Anaconda Virtual Environment Inside Project Folder
conda create -p venv python==3.7.2 -y
# Activating the created Virtual Environment
conda activate venv/
#Installing Dependencies
pip install -r requirements.txt
#Installing Pytorch for CPU
pip install torch==1.13.1+cpu torchvision==0.14.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
#Installing Intel Pytorch Optimisation Ipex Dependency
pip install intel_extension_for_pytorch==1.13.100 -f https://developer.intel.com/ipex-whl-stable-cpu
# Download end-to-end weights
curl --create-dirs -L -o weights/hybridnets.pth https://github.com/datvuthanh/HybridNets/releases/download/v1.0/hybridnets.pth
# Image inference with Intel Optimisation
python3 hybridnets_test_images.py --source demo/images --output demo_result/images --use_optimization True --enable_postprocessing True
# Image inference without Intel Optimisation
python3 hybridnets_test_images.py --source demo/images --output demo_result/images --use_optimization False --enable_postprocessing True
# Video inference with Intel Optimisation
python3 hybridnets_test_videos.py --source demo/video --output demo_result/video --use_optimization True --enable_postprocessing True
# Video inference without Intel Optimisation
python3 hybridnets_test_videos.py --source demo/video --output demo_result/video --use_optimization False --enable_postprocessing True
# Result is saved in a new folder called demo_result
HybridNets
โโโโdatasets
โโโโimgs
โ โโโโtrain
โ โโโโval
โโโโdet_annot
โ โโโโtrain
โ โโโโval
โโโโda_seg_annot
โ โโโโtrain
โ โโโโval
โโโโll_seg_annot
โโโโtrain
โโโโval
For BDD100K: (DataSets Used)
*inference time is measured in seconds.
- Expansion of domain knowledge in deep learning based computer vision techniques like object detection and segmentation.
- Usage of End2End Perception Network Hybridnet to do image and video inferencing for simultaneous object detection and segmentation.
- Importance of Robustness in Autonomous Driving: Development of a robust algorithm that could handle all weather conditions, night time conditions as evident by the results.
- Incorporation of Intel oneAPI libraries oneDNN libraries.
- Learnt about Optimisation techniques for faster inferencing, specifically the libraries developed by Intel.