Not sure about the detection part.. I setup a raspberry pi w/camera behind the peephole in my front door. I use the motion project[0] to do motion detection and recording of activity on my porch - the stream or photos from motion could be sent to some kind of detection (where presumably you'd train your own model from your own source photos of trucks or packages).
[0] https://motion-project.github.io