Can I train a CNN to detect the number of objects without localizing them first? So I was trying to search but couldn't find any answers. I was wondering if it possible to train a model to detect the number of items of interest in a photo without having bounding boxes or dots to locate the objects in the training set. 

For example say I wanted to count something simple like street poles in a photo, would it be possible with just the photos in the training set and the number of poles as the target only. So no bounding boxes or points labeled for the training data targets.
There are different approaches to achieve your goals:

1.) Provide only number of objects in an image in order to train an object detector.
This is called weak supervision or weak labeling. 

Some works that utilize this approach:


https://arxiv.org/pdf/1711.05282.pdf : Their approach is to train an object detector on image proposals, together with object counts.
https://hal.inria.fr/hal-02393688/file/1912.00384.pdf : Object detectors can be trained by providing only one categery label per image


2.) There are several works focusing on counting objects:

For example the following works focus on counting arbitrary objects:


https://arxiv.org/pdf/1903.02494.pdf
https://arxiv.org/pdf/1604.03505.pdf


For density estimations there are several works counting people:


https://arxiv.org/abs/1903.00853


Depending on the setup, it could also be used for your application,