MrRuler's currently available models
Currently, the available models provided by MrRuler are grass_carp_9_points, which is trained using images of grass carp, and crucian_carp_9_points, which is trained using images of crucian carp. These models recognize 9 feature points on the surface of grass carp and crucian carp.The following figure shows the locations of the feature points identified on the grass carp image. The 9 points identified on the image of crucian carp are the same. The distance between 1,2 represents the head length, the distance between 3,4 represents the body height, the distance between 5,6 represents the tail handle height, the distance between 1,7 represents the body length, and 1, 8, and 9 represent the total length, where the distance from the midpoint of the line connecting 8 and 9 to 1 is the total length, and the recognition result outputs these five distances. In addition, the current scale shapes that can be recognized by MrRuler are cross shape, including 5 points, and one shape, including 2 points.
Production Process
Follow ' How to Make Training Dataset ' to make your own training data. After uploading the training data, wait for 1-3 days, and we will upload the new recognition model.
How to Make Training Dataset (Taking grass_carp_9_points model recognition as an example)
1. First, prepare the original image data, it is recommended for at least 2000 png or jpg format image files.
2. Install labelme, a tool for making data sets, under Windows system.
(1) Labelme is an image annotation tool, which is mainly used for data set preparation before neural network construction. Because it is written in Python, Python integrated environment anaconda needs to be installed before use.
- Install Anaconda: official website address (https://www.anaconda.com/products/distribution).
- Find the version corresponding to the number of bits of your computer operating system, download directly, and install after download. Under normal circumstances, according to the prompt, the next can, until the prompt installation is completed. The red box options are checked below.
(2) After installing anaconda, we need to create an anaconda virtual environment labelmeenv using labelme.
- Click on the Windows system start icon, and then click on Anaconda3 (64-bit), expand the folder, the following software, click on the red zone options, enter the Anaconda Prompt (anaconda3) command line interface.
(3) Create a labelme usage environment and enter the command: conda create-name=labelmeenv python=3.6
- Choose y when you encounter options during installation.
- This command creates a virtual environment named labelmeenv, and specifies the python version to be 3.6.
- Installers can also use different virtual environment names and python versions according to their own needs.
(4) After the installation is completed, enter the created labelmeenv environment.
- Command of exit the current base environment: conda deactivate
- Command of enter the labelmeenv virtual environment: conda activate labelmeenv
- The normal operation of labelme needs to rely on the package, so we need to install pyqt5 and pyside2, and then install labelme.
- Command of install pyqt5: pip install pyqt5
- Command of install pyside2: pip install pyside2
- Command of install labelme: pip install labelme
- After successful installation, each time you use labelme, you need to enter anaconda prompt to activate the labelmeenv environment using the following command: conda activate labelmeenv
- Then enter the following command and return to open labelme:
(5) After opening the labelme, the following interface appears. Choose open to open a picture for marking, opendir can open a folder to mark multiple images. The diagram is a sketch map of grass carp marking 9 feature points. When making the training data set, the order of the feature points of the mark should be fixed. When selecting the target, no matter what the fish posture is, the box is selected from the upper left corner to the lower right corner. After the annotation is completed, select the Save option to save the generated json file together with the original file.
(6) After all the data annotation is completed, the original image and the generated json file are packaged and uploaded. In addition, you also need to prepare a configuration file to calculate the distance between points. The configuration file is a txt text file. Each line in the txt file calculates a distance, such as ( 1, 2 ) calculating the distance between 1 and 2 points, ((4,5),(8,9)) finding the midpoint between 4 and 5 and the midpoint between 8 and 9, and calculating the distance between the two midpoints. In this example, the configuration file gc.txt for calculating the distance between points of the grass carp 9-point model is as follows :
(1,2) # head length
(3,4) # body height
(5,6) # tail handle height
(1,7) # body length
(1,(8,9)) # total length
You also need to upload configuration files.