###### tags: `ТЗ`
# Updated Kindergarten Estimate 22.08
## **Pipelines comparsion**

[Current pipeline](https://imgur.com/81bM6P4.jpg)
[Optimized pipeline](https://imgur.com/Xro2L2S.jpg)
## **Questions**
Positive answer on any from the following questions will require from us additional estimates.
1. `StreamManager` should check Intersection and Ratio simultaneously?
+ What if we have both alerts from Intersection and Ratio?
3. Do you need to plot both DangerZones and Ratio in debugging?
4. Do we need to check for Ratio if we are writing 15s because of DZ alert?
## **Pipeline SpeedUp** #1 -- **8 hours**
Code refactoring which will save time on interaction with database and WebHook API.
+ Send webhook in thread -- **1 hour**
+ Write to mongo in thread -- **1 hour**
+ Use mongo connection only once per `StreamManager` -- **1 hour**
+ `StreamManager` should get all info from mongo on init (`IntersectionChecker`, `ChildAdultRatioChecker`) -- **3 hours**
+ Tests -- **2 hours**
## **Pipeline SpeedUp** #2 -- **11 hours**
It will save time on getting a frame from a camera. Otherwise, we will wait for a frame for each camera on each cycle.
+ `CameraManager` must spawn `grep_frame()` in threads or even separate processes or it should do `BatchCreator` -- **4 hours**
+ `StreamManager` should take frames as an input (`IntersectionChecker`, `ChildAdultRatioChecker`) -- **4 hours**
+ Tests -- **3 hours**
## **Pipeline SpeedUp** #3 -- **10 hours**
It will save time on neural networks inference. It needs keras YOLO3 model and *"Pipeline SpeedUP #2"*. Otherwise, we will process each camera sequentially.
+ BatchCreator -- grep frames from all cameras, create a batch for YOLO3 inference, decompose batch and output for StreamManagers -- **6 hours**
+ Check if ChildAdult classifier will be able to take a batch of bboxes from all 5 cameras -- **1 hour**
+ Tests -- **3 hours**
## **Documentation** -- **4 hours**
+ Documentation using `sphinx` -- **4 hours**
## **Refactoring** -- **10 hours**
-------
## **Total**: **43 hours**