Sight-singing pitch detection method, system, device and medium based on target detection
Through the sight-singing pitch detection method based on target detection, the two-dimensional spectrogram and YOLOX model are used to directly extract the sight-singing pitch, which solves the problems of pitch extraction complexity and time consumption in the existing technology, and achieves a faster and more efficient method. Accurate pitch detection.
Patent Information
- Application Number
- CN202210656997.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-10
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-06-10
AI Technical Summary
The pitch extraction process in existing automatic singing transcription methods is complex, resulting in a long transcription result, and there is a lack of simple and effective pitch extraction solutions.
Using a sight-singing pitch detection method based on target detection, the sight-singing audio is obtained through sampling and converted into a two-dimensional spectrogram to detect the starting moment, ending moment of the note and the frequency point index represented by the lower boundary of the note, using the frequency point box and peak search to calculate pitch, combined with the YOLOX model for note detection, and directly obtain note-level transcription results.
It improves the accuracy and efficiency of sight-singing pitch retrieval, extracts pitch simply and efficiently, reduces detection time, and enhances onset and offset detection effects.
Smart Images

Figure CN115206339B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of audio data processing, and more specifically, relates to a sight-singing pitch detection method, system, device and medium based on target detection. Background Art
[0002] Sight-singing is the process for music beginners to read music scores and sing to improve their perception of rhythm and pitch. Sight-singing is a way of singing. In existing studies, sight-singing transcription generally adopts the method of singing transcription. Automatic Singing Transcription (AST) is to infer the onset of the note start time, the offset of the note end time and the corresponding pitch of the note from the singing audio. An efficient and accurate automatic singing transcription model can help students understand their singing situation in a timely manner, and can also assist teachers in problem identification and accurate guidance, which is very important for music education.
[0003] The key to automatic singing transcription is onset, offset and pitch extraction, which is mainly divided into two categories of methods. One method directly uses an end-to-end approach to first obtain frame-level onset, offset and pitch, and then post-processes the frame-level transcription results to obtain note-level onset, offset and pitch; the other method first performs note segmentation to obtain onset and offset, and then obtains the pitch of each note through pitch extraction. Both methods first obtain frame-level onset and offset probabilities, and then obtain note-level transcription results through post-processing. It can be seen that the core of automatic singing transcription is pitch extraction. The existing pitch extraction methods are relatively complex, and it takes a long time to obtain transcription results in actual application scenarios. Therefore, there is an urgent need for a simple and effective pitch extraction solution for sight-singing. Summary of the invention
[0004] In view of the defects and improvement needs of the prior art, the present invention provides a sight-singing pitch detection method, system, device and medium based on target detection, which aims to improve the accuracy and efficiency of sight-singing pitch retrieval.
[0005] To achieve the above-mentioned purpose, according to one aspect of the present invention, a sight-singing pitch detection method based on target detection is provided, comprising: S1, sampling and acquiring sight-singing audio and converting it into a two-dimensional spectrogram, detecting the start time, end time and frequency point index represented by the lower boundary of each note in the two-dimensional spectrogram; S2, taking the frequency corresponding to the frequency point index represented by the lower boundary of the note of the first note as the center and accommodating a set number of frequency points upward and downward as the target, determining the top frequency value and the bottom frequency value of the frequency point frame of the first note, and the first note is any note in the two-dimensional spectrogram; S3, within the frequency range between the top frequency value and the bottom frequency value of the first note, performing a peak search for each frame in the two-dimensional spectrogram between the start time and the end time of the first note, and obtaining the frequency value corresponding to the peak of each frame; S4, summing and averaging the frequency values corresponding to the peak of each frame in the first note, obtaining the average frequency corresponding to the pitch of the first note, and calculating the pitch of the first note according to the average frequency corresponding to the pitch of the first note.
[0006] Furthermore, the frequency corresponding to the frequency index represented by the lower boundary of the first note is:
[0007]
[0008] Among them, f bottom is the frequency corresponding to the frequency index represented by the lower boundary of the first note; min is the minimum frequency value of the two-dimensional spectrogram; n_bins is the frequency point index represented by the lower boundary of the first note; b po1 It is the first preset parameter, indicating the number of frequency points within an octave of a two-dimensional spectrogram in which each pitch corresponds to two frequency points.
[0009] Furthermore, the top frequency value and the bottom frequency value of the frequency point frame of the first note are respectively:
[0010]
[0011]
[0012] Among them, f high is the top frequency value of the frequency point frame of the first note; f low b is the bottom frequency value of the frequency point frame of the first note; po2 is the second preset parameter, indicating the number of frequency points within an octave of a two-dimensional spectrogram in which each pitch corresponds to five frequency points.
[0013] Furthermore, the pitch of the first note is:
[0014] p=69+12×log2(f pitch / 440)
[0015] Where p is the pitch of the first note, f pitch is the average frequency corresponding to the pitch of the first note.
[0016] Furthermore, the sampling and obtaining of sight-singing audio and converting it into a two-dimensional spectrogram includes: sampling and obtaining of the sight-singing audio and performing audio noise reduction processing, and converting the noise-reduced sight-singing audio into the two-dimensional spectrogram using a constant Q transform.
[0017] Furthermore, the detection of the start time, end time and frequency point index represented by the lower boundary of each note in the two-dimensional spectrogram includes: mapping the two-dimensional spectrogram into an RGB image, and cutting the RGB image into multiple rectangular blocks, wherein the error between the aspect ratio of each rectangular block and the preset aspect ratio is not greater than a set value; performing note detection on each rectangular block respectively to detect the start time, end time and frequency point index represented by the lower boundary of each note in each rectangular block.
[0018] Furthermore, performing note detection on the rectangular block includes: performing note detection on the rectangular block using the YOLOX model to obtain one or more target frames; when there are two intersecting target frames among the multiple target frames: if more than half of one of the target frames is located within the other target frame, deleting the two intersecting target frames, and generating a new target frame containing the two intersecting target frames, otherwise, setting the right boundary of the left target frame to the left boundary of the right target frame, and updating the right target frame.
[0019] According to another aspect of the present invention, a sight-singing pitch detection system based on target detection is provided, comprising: a sampling detection module, for sampling and acquiring sight-singing audio and converting it into a two-dimensional spectrogram, detecting the start time, end time and frequency index represented by the lower boundary of each note in the two-dimensional spectrogram; a frequency point frame determination module, for taking the frequency corresponding to the frequency index represented by the lower boundary of the first note as the center and accommodating a set number of frequency points upward and downward as the target, determining the top frequency value and the bottom frequency value of the frequency point frame of the first note, wherein the first note is any note in the two-dimensional spectrogram; a peak search module, for performing a peak search for each frame in the two-dimensional spectrogram between the start time and the end time of the first note within a frequency range between the top frequency value and the bottom frequency value of the first note, and obtaining the frequency value corresponding to the peak value of each frame; a pitch calculation module, for summing and averaging the frequency values corresponding to the peak value of each frame in the first note, obtaining the average frequency corresponding to the pitch of the first note, and calculating the pitch of the first note according to the average frequency corresponding to the pitch of the first note.
[0020] According to another aspect of the present invention, there is provided an electronic device, comprising: a processor; a memory storing a computer executable program, wherein when the program is executed by the processor, the processor executes the sight-singing pitch detection method based on target detection as described above.
[0021] According to another aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the sight-singing pitch detection method based on target detection as described above is implemented.
[0022] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects:
[0023] (1) To address the problem of uneven vocal signals, a peak search method is proposed to achieve pitch assignment. Specifically, the lower boundary information of the note object boundary box is used to perform a more detailed search at the approximate fundamental frequency position to further extract the accurate pitch, which is more accurate, simple and efficient.
[0024] (2) In the field of sight-singing audio, the target detection model is used to complete note detection. Compared with the frame-based method, the note segmentation method based on target detection in the present invention can directly obtain note-level transcription results. The receptive field of the convolution is larger, the contextual information for judgment is more sufficient, and it has better onset and offset detection effects and faster detection speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 A flow chart of a sight-singing pitch detection method based on target detection provided by an embodiment of the present invention;
[0026] Figure 2 A schematic diagram of a transcription scheme design provided in an embodiment of the present invention;
[0027] Figure 3 A schematic diagram of a pitch assignment process provided by an embodiment of the present invention;
[0028] Figure 4 A schematic diagram of a peak search process provided by an embodiment of the present invention;
[0029] Figure 5 A block diagram of a sight-singing pitch detection system based on target detection provided by an embodiment of the present invention;
[0030] Figure 6 A block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0032] In the present invention, the terms "first", "second", etc. (if any) in the present invention and the accompanying drawings are used to distinguish similar objects but not necessarily to describe a specific order or sequence.
[0033] Figure 1 Flow chart of the sight-singing pitch detection method based on target detection provided by an embodiment of the present invention. Figure 1 , combined with Figure 2-Figure 4 , the sight-singing pitch detection method based on target detection in this embodiment is described in detail, the method includes operations S1-S4, and its design scheme is as follows Figure 2 shown.
[0034] Operation S1, sampling and obtaining sight-singing audio and converting it into a two-dimensional spectrogram, detecting the start time, end time and frequency point index represented by the lower boundary of each note in the two-dimensional spectrogram.
[0035] According to an embodiment of the present invention, operation S1 includes sub-operations S11 to S13.
[0036] In sub-operation S11, the sight-singing audio is sampled and converted into a two-dimensional spectrogram.
[0037] Sample the sight-singing audio and perform audio noise reduction processing, and use the constant Q transform to convert the noise-reduced sight-singing audio into a two-dimensional spectrogram. For example, use spleeter to perform audio noise reduction processing on the sight-singing audio to separate the interference of background music and metronome, making the vocal part purer. Convert the one-dimensional audio sequence into a two-dimensional spectrogram to facilitate the subsequent use of convolutional neural networks to extract high-dimensional features in the audio signal.
[0038] In sub-operation S12, the two-dimensional spectrogram is mapped into an RGB image, and the RGB image is cut into a plurality of rectangular blocks, and the error between the aspect ratio of each rectangular block and the preset aspect ratio is not greater than a set value.
[0039] The two-dimensional spectrogram is mapped to an RGB image by linear mapping according to the value of the matrix elements. Since the time dimension of the spectrogram after time-frequency transformation is very long, the RGB image can be cut along the time axis to be cut into multiple rectangular blocks with basically the same aspect ratio.
[0040] According to the linear intensity mapping, the single-channel two-dimensional spectrogram is converted into a three-channel RGB image. The specific linear intensity mapping process is, for example, using the matlab software and the viridis type colormap to complete the linear mapping from numerical values to (r, g, b) colors. First, the spectrum matrix is normalized to the maximum value, and then the normalized spectrum matrix is multiplied by 256 to obtain a spectrum matrix of floating point data type with a dynamic range of 0-256; then, according to the value of each point in the spectrum matrix, linear interpolation is performed in the viridis colormap to obtain the interpolated (r, g, b) value, and finally, the RGB image can be constructed according to the (r, g, b) value of each point.
[0041] In the embodiment of the present invention, a signal processing-based method is used to find the cutting points in the sound signal, and then the cutting points are used to cut the spectrum graph in the time dimension, and finally a roughly rectangular graphic block is obtained by cutting. Preferably, the specific steps of using the automatic cutting algorithm to find the cutting points are as follows:
[0042] 1) Use librosa.efffects.split function to cut the audio into non-silent segments Si, i = {1, 2, 3, ..., M}, M is the total number of non-silent segments, where Si = (start_i, end_i) represents the start time and end time of the non-silent segment.
[0043] 2) Define ratio to describe the shape of different slice image blocks:
[0044] ratio = w / h-1
[0045] Among them, w and h represent the width and height of the slice respectively, and the calculation formula is as follows:
[0046] w=frame len *scale
[0047] h=n bins *scale
[0048] Among them, frame len is the length of the time dimension of the original spectrum matrix, n bins is the frequency points of the transformation, and scale is the scaling factor. len The calculation formula is as follows:
[0049] frame len =d*sr / hop_len
[0050] Where d is the time length, sr is the first transformation parameter, and hop_len is the second transformation parameter. Combining the above formula, the calculation formula R of ratio is as follows:
[0051]
[0052] 3) Define the best aspect ratio best_ratio and the maximum aspect ratio max_ratio. When |ratio|<=best_ratio, the block is considered to be optimally cut. When best_ratio<|ratio|<=max_ratio, the block is considered to be slightly too long or too short. When |ratio|>max_ratio, the block is considered to be too long or too short. In actual operation, it is found that best_ratio=0.2 and max_ratio=0.65 are more appropriate. At the same time, considering that there may be long silent segments in the audio, a cutting function C is set for long silent segments.
[0053] 4)Remember the cutting point array as splits.
[0054] In sub-operation S13, note detection is performed on each rectangular block to detect the start time, end time and frequency point index represented by the lower boundary of each note in each rectangular block.
[0055] Note detection is to detect the start and end time of each note in the audio to achieve separation of notes in the time domain. In the embodiment of the present invention, from the perspective of target detection, the evolution process of each note in the two-dimensional spectrogram is regarded as a note target and detected using a target detection model.
[0056] Specifically, the YOLOX model is used to detect notes on the rectangular block to obtain one or more target frames. When there are two intersecting target frames among the multiple target frames: if more than half of one of the target frames is located in the other target frame, the two intersecting target frames are deleted and a new target frame containing the two intersecting target frames is generated; otherwise, the right boundary of the left target frame is set to the left boundary of the right target frame, and the right target frame is updated.
[0057] During the note detection process, a rectangular block may include multiple target frames, indicating the presence of multiple notes. In sight-singing audio, since human voice is monophonic, there will only be one note in each target frame. For target frame A and target frame B, target frame A is in front, and the upper left corner coordinates [x a1 ,y a1 ], the lower right corner coordinate [x a2 ,y a2 ]; target frame B is behind, upper left corner coordinate [x b1 ,y b1 ], the lower right corner coordinate [x b2 ,y b2], when target frame A and target frame B intersect, and more than half of the area of one target frame is in the other target frame, then remove target frame A and target frame B, and generate target frame C containing target frame A and target frame B. The coordinates of the upper left corner of target frame C are [min(x a1 ,x b1 ), min(y a1 ,y b2 )], the coordinates of the lower right corner are [max(x a2 ,x b2 ),max(y a2 ,y b2 )].
[0058] Secondly, since the next human voice starts after the previous one is finished, two adjacent bounding boxes should not intersect. For the target box A and the target box B mentioned above, when the target box A and the target box B intersect, and the part of each target box in the other target box is less than half, the right boundary of the target box A is set to the left boundary of the target box B, and the target box B is updated.
[0059] After deletion and update, the starting time onset, ending time offset and frequency index n_bins represented by the lower boundary of the note are obtained from the left, right and lower boundary frames of each target frame. Among them, the starting time onset corresponds to the left boundary of the target frame, the ending time offset corresponds to the right boundary of the target frame, and the frequency index n_bins represented by the lower boundary of the note corresponds to the lower boundary of the target frame. The starting time onset and ending time offset are part of the transcription result, and the frequency index n_bins represented by the lower boundary of the note is used to assist in the determination of the subsequent transcription high fpitch.
[0060] Furthermore, since the spectrum cutting was performed before, it is necessary to time-shift the onset and offset of each target frame, and finally splice all the spectrum image blocks along the time axis. At the same time, add the time offset corresponding to the previous sound spectrum image to the onset and offset of the note in each frame to obtain the onset and offset values relative to the complete audio.
[0061] Operation S2, with the frequency index corresponding to the frequency represented by the lower boundary of the first note as the center, and accommodating a set number of frequency points upward and downward as the goal, determines the top and bottom frequency values of the frequency point frame of the first note, and the first note is any note in the two-dimensional spectrogram.
[0062] According to an embodiment of the present invention, the frequency corresponding to the frequency point index represented by the lower boundary of the first note is:
[0063]
[0064] Among them, f bottom The frequency corresponding to the frequency index represented by the lower boundary of the first note; f min is the minimum frequency value of the two-dimensional spectrogram; n_bins is the frequency point index represented by the lower boundary of the first note; b po1 It is the first preset parameter, indicating the number of frequency points within an octave of a two-dimensional spectrogram in which each pitch corresponds to two frequency points.
[0065] According to an embodiment of the present invention, the top frequency value and the bottom frequency value of the frequency point frame of the first note are respectively:
[0066]
[0067]
[0068] Among them, f high is the top frequency value of the frequency point box of the first note; f low is the bottom frequency value of the frequency point box of the first note; b po2 is the second preset parameter, indicating the number of frequency points within an octave of a two-dimensional spectrogram in which each pitch corresponds to five frequency points.
[0069] Operation S3, within the frequency range between the top frequency value and the bottom frequency value of the first note, perform a peak search on each frame of the two-dimensional spectrogram between the start time and the end time of the first note to obtain the frequency value corresponding to the peak of each frame.
[0070] For each note, the frequency value f at the top of the note high and the bottom frequency value f low In the frequency range between , perform a peak search for each frame in the spectrum from the start time onset to the end time offset, and obtain the frequency corresponding to the peak of each frame, such as Figure 4 shown.
[0071] Operation S4, summing and averaging the frequency values corresponding to the peak values of each frame in the first note to obtain the average frequency corresponding to the pitch of the first note, and calculating the pitch of the first note according to the average frequency corresponding to the pitch of the first note.
[0072] In the field of music, pitch refers to the human psychological perception of the height of the fundamental frequency of a note. In the field of music, the fundamental frequency of the sound is usually used to represent the pitch.
[0073] For each note, the frequency corresponding to each frame peak in the time range from the start time onset to the end time offset is summed and averaged to obtain the average frequency corresponding to the predicted note pitch, such as Figure 3 According to an embodiment of the present invention, the pitch of the first note is:
[0074] p=69+12×log2(f pitch / 440)
[0075] Where p is the pitch of the first note, f pitch is the average frequency corresponding to the pitch of the first note. Accordingly, the starting time, ending time and pitch of each note in the sight-singing audio can be obtained.
[0076] Figure 5 A block diagram of a sight-singing pitch detection system based on target detection provided by an embodiment of the present invention. Figure 5 The sight-singing pitch detection system 500 based on target detection includes a sampling detection module 510, a frequency point frame determination module 520, a peak search module 530 and a pitch calculation module 540.
[0077] The sampling detection module 510, for example, performs operation S1, which is used to sample and obtain sight-singing audio and convert it into a two-dimensional spectrogram, and detect the start time, end time and frequency point index represented by the lower boundary of each note in the two-dimensional spectrogram.
[0078] The frequency point frame determination module 520, for example, performs operation S2, which is used to determine the top and bottom frequency values of the frequency point frame of the first note with the frequency corresponding to the frequency index represented by the lower boundary of the note of the first note as the center and to accommodate a set number of frequency points upward and downward respectively as the goal. The first note is any note in the two-dimensional spectrogram.
[0079] The peak search module 530, for example, executes operation S3, which is used to perform a peak search for each frame in the two-dimensional spectrogram between the start time and the end time of the first note within the frequency range between the top frequency value and the bottom frequency value of the first note, and obtain the frequency value corresponding to the peak of each frame.
[0080] The pitch calculation module 540, for example, performs operation S4 to sum and average the frequency values corresponding to the peak values of each frame in the first note to obtain the average frequency corresponding to the pitch of the first note, and calculates the pitch of the first note according to the average frequency corresponding to the pitch of the first note.
[0081] The sight-singing pitch detection system 500 based on target detection is used to perform the above Figure 1-Figure 4 The sight-singing pitch detection method based on target detection in the illustrated embodiment. For details not provided in this embodiment, please refer to the aforementioned Figure 1-Figure 4 The sight-singing pitch detection method based on target detection in the illustrated embodiment will not be described in detail here.
[0082] The embodiment of the present disclosure also shows an electronic device, such as Figure 6As shown, the electronic device 600 includes a processor 610 and a readable storage medium 620. The electronic device 600 can execute the above Figure 1-Figure 4 The object detection based sight-singing pitch detection method described in .
[0083] Specifically, the processor 610 may include, for example, a general-purpose microprocessor, an instruction set processor and / or a related chipset and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 610 may also include an onboard memory for cache purposes. The processor 610 may be a processor for executing reference Figure 1-Figure 4 The described method flow according to the embodiment of the present disclosure may be a single processing unit or multiple processing units for different actions.
[0084] The readable storage medium 620, for example, can be any medium capable of containing, storing, conveying, propagating or transmitting instructions. For example, the readable storage medium can include, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device, device or propagation medium. Specific examples of readable storage media include: a magnetic storage device, such as a magnetic tape or a hard disk (HDD); an optical storage device, such as a compact disk (CD-ROM); a memory, such as a random access memory (RAM) or flash memory; and / or a wired / wireless communication link.
[0085] The readable storage medium 620 may include a computer program 621, which may include code / computer executable instructions, which when executed by the processor 610 causes the processor 610 to perform, for example, the above-mentioned combination Figure 1-Figure 4 The described method sequences and any variations thereof.
[0086] The computer program 621 may be configured to have, for example, computer program codes including computer program modules. For example, in an exemplary embodiment, the codes in the computer program 621 may include one or more program modules, for example, including 621A, module 621B, ... It should be noted that the division method and number of modules are not fixed, and those skilled in the art may use appropriate program modules or program module combinations according to actual conditions. When these program module combinations are executed by the processor 610, the processor 610 may execute, for example, the above combination of Figure 1-Figure 4 The described method sequences and any variations thereof.
[0087] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A sight-singing pitch detection method based on target detection, characterized in that: include: S1, sampling and obtaining sight-singing audio and converting it into a two-dimensional spectrogram, detecting the start time, end time and frequency index represented by the lower boundary of each note in the two-dimensional spectrogram; S2, taking the frequency corresponding to the frequency index represented by the lower boundary of the first note as the center and accommodating a set number of frequency points upward and downward as the goal, determining the top frequency value and the bottom frequency value of the frequency point frame of the first note, wherein the first note is any note in the two-dimensional spectrogram; S3, performing a peak search on each frame in the two-dimensional spectrogram between the start time and the end time of the first note within a frequency range between the top frequency value and the bottom frequency value of the first note, to obtain a frequency value corresponding to the peak value of each frame; S4, summing and averaging the frequency values corresponding to the peak values of each frame in the first note to obtain an average frequency corresponding to the pitch of the first note, and calculating the pitch of the first note according to the average frequency corresponding to the pitch of the first note.
2. The sight-singing pitch detection method based on target detection as claimed in claim 1, characterized in that: The frequency corresponding to the frequency point index represented by the lower boundary of the first note is: Among them, f bottom is the frequency corresponding to the frequency index represented by the lower boundary of the first note; min is the minimum frequency value of the two-dimensional spectrogram; n_bins is the frequency point index represented by the lower boundary of the first note; b po1 It is the first preset parameter, indicating the number of frequency points within an octave of a two-dimensional spectrogram in which each pitch corresponds to two frequency points.
3. The sight-singing pitch detection method based on target detection as claimed in claim 2, characterized in that, The top frequency value and bottom frequency value of the frequency point frame of the first note are respectively: Among them, f high is the top frequency value of the frequency point frame of the first note; f low b is the bottom frequency value of the frequency point frame of the first note; po2 is the second preset parameter, indicating the number of frequency points within an octave of a two-dimensional spectrogram in which each pitch corresponds to five frequency points.
4. The sight-singing pitch detection method based on target detection as claimed in claim 1, characterized in that: The pitch of the first note is: p=69+12×log2(f pitch / 440) Where p is the pitch of the first note, f pitch is the average frequency corresponding to the pitch of the first note.
5. The sight-singing pitch detection method based on target detection as claimed in claim 1, characterized in that, The sampling and obtaining of sight-singing audio and converting into a two-dimensional spectrogram comprises: The sight-singing audio is sampled and subjected to audio noise reduction processing, and the noise-reduced sight-singing audio is converted into the two-dimensional spectrogram using a constant Q transform.
6. The sight-singing pitch detection method based on target detection as described in any one of claims 1 to 5, characterized in that: The detecting of the start time, the end time and the frequency point index represented by the lower boundary of each note in the two-dimensional spectrogram includes: Mapping the two-dimensional spectrogram into an RGB image, and cutting the RGB image into a plurality of rectangular blocks, wherein the error between the aspect ratio of each rectangular block and a preset aspect ratio is not greater than a set value; Note detection is performed on each of the rectangular blocks respectively to detect the start time, end time and frequency point index represented by the lower boundary of each note in each of the rectangular blocks.
7. The sight-singing pitch detection method based on target detection as claimed in claim 6, characterized in that: Performing note detection on the rectangular block includes: Using the YOLOX model to perform note detection on the rectangular block to obtain one or more target boxes; When there are two intersecting target frames among multiple target frames: if more than half of one of the target frames is located in the other target frame, delete the two intersecting target frames and generate a new target frame containing the two intersecting target frames; otherwise, set the right boundary of the left target frame to the left boundary of the right target frame and update the right target frame.
8. A sight-singing pitch detection system based on target detection, characterized in that: include: A sampling detection module, used for sampling and obtaining sight-singing audio and converting it into a two-dimensional spectrogram, detecting the start time, end time and frequency index represented by the lower boundary of each note in the two-dimensional spectrogram; A frequency point frame determination module is used to determine the top frequency value and the bottom frequency value of the frequency point frame of the first note with the frequency point index corresponding to the lower boundary of the note of the first note as the center and the set number of frequency points accommodated upward and downward respectively as the target, wherein the first note is any note in the two-dimensional spectrogram; A peak search module, configured to perform a peak search on each frame of the two-dimensional spectrogram between the start time and the end time of the first note within a frequency range between the top frequency value and the bottom frequency value of the first note, to obtain a frequency value corresponding to the peak value of each frame; The pitch calculation module is used to sum and average the frequency values corresponding to the peak values of each frame in the first note to obtain the average frequency corresponding to the pitch of the first note, and calculate the pitch of the first note according to the average frequency corresponding to the pitch of the first note.
9. An electronic device, characterized in that: include: processor; A memory storing a computer executable program, wherein when the program is executed by the processor, the processor executes the sight-singing pitch detection method based on target detection as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the sight-singing pitch detection method based on target detection as described in any one of claims 1 to 7 is implemented.
