The present invention relates to a labeling method and an electronic device thereof, especially an automatically labeling method of training data, and an electronic device thereof.
Artificial intelligence (AI) is a category of computer science, which means that machines have the same thinking logic and behavior patterns as humans.
Further, machine learning is one of the ways to achieve the AI. The machine learning builds a model based on training data in order to allow the machines to learn from the training data, so that the machines can make predictions or decisions by the model.
One of the applications of using the model of the machine learning is image recognition. However, when preparing the training data of the model, it is usually necessary to manually label objects in images, which takes a lot of manpower and time. Therefore, a method for manually labeling the objects in the images needs to be improved.
In view of the above-mentioned needs, the main purpose of the present invention is to provide an automatically labeling method of training data, and an electronic device thereof. The automatically labeling electronic device of training data includes a camera, a screen, and a processor. The processor is electrically connected to the camera and the screen.
The processor executes the automatically labeling method of training data to start the camera, display a mark on a marking position of the screen, and determine whether a record button is triggered.
When the record button is triggered, the processor starts recording a training video, and determines whether a stop button is triggered.
When the stop button is triggered, the processor stops recording the training video to complete the training video, and the training video includes a plurality of frames and the marking position.
Further, after the training video is completed, the processor respectively generates a target scope according to the marking position for each of the frames, and respectively labels an object in the target scope of each of the frames of the training video as training data.
Therefore, the automatically labeling electronic device of the present invention can automatically prepare the training data, so that manpower and time can be reduced.
Therefore, the automatically labeling electronic device of the present invention can automatically label the objects in the frame of the training video as the training data. Namely, the present invention can allow a user to automatically label the objects in the frames of the training video when the training video is recorded for saving a lot of manpower and time.
In the following, the technical solutions in the embodiments of the present invention will be clearly and fully described with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of, not all of, the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
In steps S101 to S103, when the processor 12 executes the automatically labeling method of training data, the processor 12 starts the camera 11, displays a mark 131 on a marking position of the screen 13, and determines whether a record button 132 is triggered. For example, with reference to
In steps S104 to S105, when the record button 132 is triggered, the processor 12 starts recording a training video, and determines whether a stop button 133 is triggered. For example, with reference to
In steps S106 to S109, when the stop button 133 is triggered, the processor 12 stops recording the training video, determines a target name, uses the target name to name the training video, and then completes the training video. For example, with reference to
In steps S110 to S111, after the training video is completed, the processor 12 further respectively generates a target scope according to the marking position for each of the frames of the training video, and respectively labels the object 30 in the target scope of each of the frames of the training video as training data for training the model. In the embodiment, the processor 12 labels the objects 30 by the target name determined in step S107.
Moreover, with reference to
In steps S112 to S114, when the record button 132 is untriggered, the processor 12 further determines whether a marking position modifying button 135 is triggered. For example, with reference to
Moreover, with reference to
In the embodiment, each of the target scopes of the frames is a circumscribed polygon of the contour of the object, and the circumscribed polygon is a rectangle. For example, the processor 12 determines a maximum and a minimum in X axis, and a maximum and a minimum in Y axis, to be four endpoints of the rectangle. Namely, the four endpoints of the rectangle are (Xmax, Ymax), (Xmax, Ymin), (Xmin, Ymin), and (Xmin, Ymax). The Xmax is the maximum in the X axis, Xmin is the minimum in the X axis, Ymax is the maximum in the Y axis, and Ymin is the minimum in the Y axis.
In conclusion, the processor 12 can automatically determine the target scope of the object 30 according to the marking position displaying the mark 131. Further, the processor 12 can automatically label the object 30 by the target name. Therefore, the automatically labeling electronic device 10 can use the target name and the target scope to automatically label the objects 30 in the frames of the training video as the training data of the model for saving a lot of manpower and time.
Even though numerous characteristics and advantages of the present invention have been set forth in the foregoing description, together with details of the structure and function of the invention, the disclosure is illustrative only. Changes may be made in detail, especially in matters of shape, size, and arrangement of parts within the principles of the invention to the full extent indicated by the broad general meaning of the terms in which the appended claims are expressed.