DatasetDM: Synthesizing Data with Perception Annotations Using Diffusion Models