Library to count number of objects in image?
I think the OP was asking for a specific library for Theano or TensorFlow that provides off-the-shelf functionality for object identification.
I would look first into scikit image, an image processing library for Python in the Scipy/Numpy stack. It has all sorts of edge detectors, blob detectors, shape identifications, color separations... Look at their gallery of examples.
Btw, counting humans in a crowd may not be so trivial to automate...