Enumerative invariants from categories