Abstract
The disclosure provides a method for generating training data and an electronic device. The method includes: obtaining an object model of a specific object; obtaining a first image when the object model is positioned at a first angle and a first silhouette corresponding to the first image; retrieving a first object image representing the specific object positioned at the first angle from the first image based on the first silhouette; embedding the first object image into a first background image to generate a first training image; generating a first labeled data of the first object image in the first training image; and defining the first training image and the first labeled data as a first training data of the specific object.