Yolov5 shift issue

Hello everyone ,
I used two yolov5 models. My first model detects the tray. In my second model, it finds food types.

The size of the first model was 416, then I cropped it. I sent it to the second model. The size of my second model is 224.

The reason for the shift problem is crop . It detective the food in the cropped image. Draws the result for the original image. It should change according to the center of the tray. I understand the problem, but I didn’t understand how to change it.

I created a table in debug mode. I wrote the values.
Do I need to increase xPos and yPos values when drawing? There are only location values in the MultiBoxerTracker file. bottom, left right, top. I’m so confused. I would love any help,advice. Thanks a lot.