# Checkpoint object detection api

**URL:** <https://community.deeplearning.ai/t/checkpoint-object-detection-api/536090>\
**Category:** Advanced Computer Vision with TensorFlow\
**Tags:** week-module-2\
**Created:** [January 5, 2024, 9:00am UTC](https://community.deeplearning.ai/t/checkpoint-object-detection-api/536090 "2024-01-05T09:00:27Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [January 5, 2024, 5:39pm UTC](https://community.deeplearning.ai/t/checkpoint-object-detection-api/536090/6 "2024-01-05T17:39:03Z")

</div>

Hello @Olfa,

This explanation going to be lengthy one as I am explaining you from beginning.

Once we restore weights from checkpoint, we use parts of RetinaNet to reuse for  
feature extraction layers and bounding box regression layer. I am sharing images for each procedure being done in the assignment for better understanding

 ![Screenshot 1945-10-15 at 6.40.35 PM](https://global.discourse-cdn.com/dlai/original/3X/3/d/3d54a7e2519a4da91a07047e1738153ba7a910be.png)

Once model is detected, we check the class variable in the detection model which shows how box predictor is related WeightSharedConvolutionalBoxPredictor

 ![Screenshot 1945-10-15 at 10.36.38 PM](https://global.discourse-cdn.com/dlai/original/3X/c/b/cb864b67354c4a9fd584287edf869f309f155800.png)

Further \_box\_predictor is inspected for the class type which gives the input you are mentioning object\_detection.predictors.convolutional\_keras\_box\_predictor.WeightSharedConvolutionalBoxPredictor

 ![Screenshot 1945-10-15 at 10.37.39 PM](https://global.discourse-cdn.com/dlai/original/3X/4/2/42e8b6e284f600b497d811e4d7ebd26eb8015230.png)

After inspection, variables are checked for the box\_predictor, which gives the below details

 ![Screenshot 1945-10-15 at 10.47.46 PM](https://global.discourse-cdn.com/dlai/original/3X/1/c/1cd581a75512fa6d7d5e8dceb07ada836f8b9be3.png)

So when one inspects the \_box\_prediction\_head and \_predictions head at convolution keras\_box\_predictor.py file, it will point towards the bounding box predictions and the class\_predict\_heads which is a list of heads that predict the classes.

 ![Screenshot 1945-10-15 at 10.49.46 PM](https://global.discourse-cdn.com/dlai/original/3X/4/0/40a1918e04348cdfb93756480a7718ba1683bada.png)

Hence \_box\_predictor.\_prediction\_heads contain a dictionary that points to both the prediction layers (bounding boxes and the class(category)).

Now while defining checkpoints for the desired layers, in this checkpoints for box predictor and then for the model which directs you to this box predictor as well as the prediction layers, model directs to the prediction box head from previously defined or determined bounding box

Then one defines box\_predictors\_checkpoints to be checkpoint for these two layers of the detection\_model box predictor by using tf.train.Checkpoint (which know that the box prediction head is the prediction layer for bounding boxes which gives you the same variable in the previous exercise when one was trying to restore the checkpoint and inspecting box\_prediction head i.e.

 ![Screenshot 1945-10-15 at 11.02.42 PM](https://global.discourse-cdn.com/dlai/original/3X/b/0/b0ec7ad93d87ad26a99a37ca537b8f01c7bb90ea.png)

I know it is lengthy read, read it again and again on how it is related. Feel free to ask if it is confusing or more doubts.

Regards  
DP

---

_[View the full topic](https://community.deeplearning.ai/t/checkpoint-object-detection-api/536090)._
