Object detection by using label from folder name

I am a beginner to object detection task. Should we do labeling using bounding box or segmentation for object detection task?
What about using the folder names as labels and doing multi object detection? If it is possible, can anyone please provide me some sources or any working note book?