The invention discloses a method and system for converting an anchor-free algorithm into an anchor-based algorithm, and the method comprises the steps: 1, calculating all grid information in the anchor-free algorithm, and obtaining a predicted value of the anchor-free algorithm; step 2, according to a specific rule of generating anchors by an anchor-based algorithm, generating anchors of which the shape and the number are the same as those of grids in the anchor-free algorithm, and according to the anchor-based algorithm, generating anchors of which the shape and the number are the same as those of grids in the anchor-free algorithm; step 3, according to the grid predicted value of the anchor-free algorithm and the anchor predicted value of the anchor-based algorithm, establishing a conversion relation for converting the anchor-free algorithm into the anchor-based algorithm; and step 4, according to the conversion relationship, setting a corresponding layer in the neural network, and realizing conversion of the anchor-free predicted value into an anchor-based predicted value. According to the method, the anchor-free algorithm can be deployed more quickly, the anchor-free algorithm and the anchor-based algorithm are unified into one set of operation, and subsequent application and use are facilitated.