CN111460195B - Picture processing method and device, storage medium and electronic equipment - Google Patents
Picture processing method and device, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN111460195B CN111460195B CN202010225852.6A CN202010225852A CN111460195B CN 111460195 B CN111460195 B CN 111460195B CN 202010225852 A CN202010225852 A CN 202010225852A CN 111460195 B CN111460195 B CN 111460195B
- Authority
- CN
- China
- Prior art keywords
- pictures
- category
- picture
- target category
- similarity
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/55—Clustering; Classification
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Biophysics (AREA)
- Evolutionary Computation (AREA)
- Biomedical Technology (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Computational Linguistics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Databases & Information Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Image Analysis (AREA)
Abstract
The application discloses a picture processing method, a picture processing device, a storage medium and electronic equipment. The picture processing method can be applied to the electronic equipment, and comprises the following steps: acquiring a plurality of pictures; classifying the plurality of pictures to obtain at least one category; determining a target category meeting preset conditions from the at least one category; and clustering the pictures contained in each target category to obtain a clustering result of each target category. The method and the device can effectively manage the pictures.
Description
Technical Field
The application belongs to the technical field of pictures, and particularly relates to a picture processing method, a picture processing device, a storage medium and electronic equipment.
Background
As the photographing capability of electronic devices becomes stronger, users often use the electronic devices to take pictures, such as users can take pictures of scenery, people, etc. The photos taken by the user are typically stored in an album of the electronic device so that the user can review the photos at any time. In addition, pictures downloaded by users from the network are also typically stored in photo albums. However, in the related art, the electronic device cannot effectively manage the picture.
Disclosure of Invention
The embodiment of the application provides a picture processing method, a picture processing device, a storage medium and electronic equipment, which can effectively manage pictures.
In a first aspect, an embodiment of the present application provides a method for processing a picture, which is applied to an electronic device, and the method includes:
acquiring a plurality of pictures;
classifying the plurality of pictures to obtain at least one category;
determining a target category meeting preset conditions from the at least one category;
and clustering the pictures contained in each target category to obtain a clustering result of each target category.
In a second aspect, an embodiment of the present application provides a picture processing apparatus, applied to an electronic device, where the apparatus includes:
the acquisition module is used for acquiring a plurality of pictures;
the classification module is used for classifying the pictures to obtain at least one category;
the determining module is used for determining a target category meeting preset conditions from the at least one category;
and the clustering module is used for clustering pictures contained in each target category to obtain a clustering result of each target category.
In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, which when executed on a computer, causes the computer to execute a flow in the picture processing method provided in the embodiment of the present application.
In a fourth aspect, an embodiment of the present application further provides an electronic device, including a memory, and a processor, where the processor executes a flow in the picture processing method provided in the embodiment of the present application by calling a computer program stored in the memory.
In this embodiment of the present application, after a plurality of pictures are acquired, the electronic device may classify the plurality of pictures to obtain at least one category. The electronic equipment can determine the target category meeting the preset condition from the at least one category, and cluster the pictures under each target category, so that a clustering result of the pictures under each target category is obtained. Therefore, in the embodiment of the application, the electronic device can classify the pictures once and then cluster the pictures of the target class once on the basis of classification, so that the pictures are subdivided. The subdivision of the pictures is beneficial to searching and browsing the pictures, so that the embodiment of the application can realize effective management of the pictures.
Drawings
The technical solution of the present application and the advantageous effects thereof will be made apparent from the following detailed description of the specific embodiments of the present application with reference to the accompanying drawings.
Fig. 1 is a flow chart of a picture processing method provided in an embodiment of the present application.
Fig. 2 is another flow chart of a picture processing method according to an embodiment of the present application.
Fig. 3 is a schematic architecture diagram of a twin neural network according to an embodiment of the present application.
Fig. 4 to 8 are schematic views of a picture processing method according to an embodiment of the present application.
Fig. 9 is a schematic structural diagram of a picture processing device according to an embodiment of the present application.
Fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Fig. 11 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Referring to the drawings, wherein like reference numerals refer to like elements throughout, the principles of the present application are illustrated as embodied in a suitable computing environment. The following description is based on the illustrated embodiments of the present application and should not be taken as limiting other embodiments not described in detail herein.
It is understood that the execution subject of the embodiments of the present application may be an electronic device such as a smart phone or tablet computer.
Referring to fig. 1, fig. 1 is a flowchart of a picture processing method according to an embodiment of the present application, where the flowchart may include:
101. and acquiring a plurality of pictures.
As the photographing capability of electronic devices becomes stronger, users often use the electronic devices to take pictures, such as users can take pictures of scenery, people, etc. The photos taken by the user are typically stored in an album of the electronic device so that the user can review the photos at any time. In addition, pictures downloaded by users from the network are also typically stored in photo albums. However, in the related art, the electronic device generally can classify the pictures stored in the album only according to the photographing time or photographing place, etc. That is, in the related art, the electronic device cannot effectively manage the picture.
In the embodiment of the present application, for example, the electronic device may first obtain multiple pictures. For example, the electronic device may obtain all pictures stored in an album.
102. And classifying the pictures to obtain at least one category.
For example, after a plurality of pictures are obtained, the electronic device may classify the plurality of pictures to obtain at least one category.
For example, after acquiring the pictures stored in the album, the electronic device may classify the pictures stored in the album into a plurality of categories, such as a picture of a landscape category, a picture of a plant category, a picture of an animal category, a picture of a vehicle category, and so on.
103. And determining the target category meeting the preset condition from at least one category.
For example, after classifying the plurality of pictures to obtain at least one category, the electronic device may determine a target category that satisfies the preset condition from the at least one category.
For example, after dividing the pictures stored in the album into a picture of a landscape category, a picture of a plant category, a picture of an animal category, a picture of a vehicle category, the electronic device may determine a category satisfying a preset condition from among 4 categories of the landscape category, the plant category, the animal category, the vehicle category, and determine it as the target category. For example, the electronic device determines a landscape category and a plant category as target categories.
104. And clustering the pictures contained in each target category to obtain a clustering result of each target category.
For example, after determining the target categories, the electronic device may perform clustering processing on the pictures included in each target category, so as to obtain a clustering result under each target category.
For example, after determining the scenery category and the plant category as the target categories, the electronic device may cluster the pictures of the scenery category, thereby obtaining a clustering result under the scenery category. The electronic equipment can also cluster the pictures of the plant categories, so that a clustering result under the plant categories is obtained. For example, after clustering, the pictures belonging to the landscape class are clustered into 3 clusters, and the 3 clusters are respectively a peak class picture, a sea scene class picture, a lake scene class picture and the like. The pictures belonging to the plant category are clustered into 2 clusters after clustering, and the 2 clusters are respectively pictures of the flower category, pictures of the tree category and the like.
It can be appreciated that in the embodiment of the present application, after a plurality of pictures are acquired, the electronic device may classify the plurality of pictures to obtain at least one category. The electronic equipment can determine the target category meeting the preset condition from the at least one category, and cluster the pictures under each target category, so that a clustering result of the pictures under each target category is obtained. Therefore, in the embodiment of the application, the electronic device can classify the pictures once and then cluster the pictures of the target class once on the basis of classification, so that the pictures are subdivided. The subdivision of the pictures is beneficial to searching and browsing the pictures, so that the embodiment of the application can realize effective management of the pictures.
Referring to fig. 2, fig. 2 is another flow chart of the image processing method provided in the embodiment of the present application, where the flow may include:
201. the electronic device obtains a plurality of pictures.
For example, the electronic device may first obtain all the pictures in its album.
202. And the electronic equipment classifies the plurality of pictures by using a lightweight picture classification algorithm to obtain at least one category.
For example, after all the pictures in the album are acquired, the electronic device may classify all the pictures in the album by using a lightweight picture classification algorithm MobileNet V2 to obtain at least one category.
It should be noted that, the MobileNet V2 is a general purpose computer vision neural network designed for electronic devices, especially mobile devices, and may be used to implement image classification, object detection, and semantic segmentation. Of course, other lightweight picture classification algorithms such as mobilet V1, mobilet V3, etc. may be used for the electronic device in the embodiment of the present application, which is not limited in detail.
In this embodiment of the present application, the lightweight image classification algorithm used for classifying images may be a neural network that is trained in advance through learning. For example, the lightweight picture classification algorithm may be pre-trained in the desired categories, and so on. When a picture to be classified is input into a lightweight picture classification algorithm which is subjected to learning training in advance, such as a MobileNet V2 neural network, the lightweight picture classification algorithm can output the classification of the picture, namely the electronic equipment can obtain the classification of the picture.
For example, using a lightweight picture classification algorithm MobileNet V2 that has been trained in advance, the electronic device classifies all pictures in the album into a picture of a landscape category, a picture of a plant category, a picture of an animal category, a picture of a vehicle category, and so on.
In one embodiment, the electronic device may create a corresponding folder or picture set for each category of pictures for storing the pictures of that category. For example, the electronic device may create a folder named "landscape" for storing pictures of landscape categories, create a folder named "plant" for storing pictures of plant categories, create a folder named "animal" for storing pictures of animal categories, create a folder named "vehicle" for storing pictures of vehicle categories, and so forth.
203. The electronic equipment determines a target category meeting a preset condition from at least one category, wherein the target category meeting the preset condition is a category containing pictures with the number larger than or equal to a preset numerical value.
For example, after classifying all the pictures in the album into 4 categories, i.e., a picture of a landscape category, a picture of a plant category, a picture of an animal category, and a picture of a vehicle category, the electronic device may determine a target category satisfying a preset condition from the 4 categories, where the target category satisfying the preset condition may be a category in which the number of the included pictures is greater than or equal to a preset value.
For example, the preset value is 30 sheets. Then, the electronic device may determine a category containing at least 30 pictures as a target category. For example, there are 50 pictures of landscape category, 35 pictures of plant category, 20 pictures of animal category, and 5 pictures of vehicle category. Then, since the picture of the landscape category and the picture of the plant category are each larger than 30, the electronic device can determine the landscape category and the plant category as the target category. And because the number of pictures of the animal category and the number of pictures of the vehicle category are less than 30, the electronic device does not determine the animal category and the vehicle category as target categories.
204. And the electronic equipment calculates the similarity of every two pictures contained in each target category to obtain the similarity of every two pictures contained in each target category.
205. The electronic equipment clusters according to the similarity of every two pictures contained in each target category to obtain at least one cluster under each target category, wherein the similarity between every two pictures contained in the same cluster is larger than or equal to a preset threshold value.
For example, 204 and 205 may include:
after determining the target categories, the electronic device may perform clustering processing on the pictures included in each target category, so as to obtain a clustering result of the pictures in each target category.
In the embodiment of the present application, the electronic device may perform clustering processing on the pictures included in each target category by: the electronic device may perform similarity calculation on each of the two pictures included in each of the target categories, so as to obtain a similarity of each of the two pictures included in each of the target categories. Then, the electronic device may perform clustering processing on the pictures according to the similarity of every two pictures included in each target category, so as to obtain at least one cluster under each target category, where the similarity between every two pictures included in the same cluster is greater than a preset threshold.
For example, the electronic device may perform clustering on the pictures of the landscape category and clustering on the pictures of the plant category. When clustering is performed on the pictures in the landscape category, the electronic device can calculate the similarity of every two pictures in the landscape category, and then cluster the pictures in the landscape category according to the similarity of every two pictures in the landscape category, so as to obtain at least one cluster in the landscape category, wherein the similarity between every two pictures in the same cluster is larger than or equal to a preset threshold value. For example, pictures in a landscape category are clustered into 3 clusters, and the 3 clusters are a picture of a mountain category, a picture of a sea category, a picture of a lake category, and the like, respectively. The similarity between every two pictures in the mountain class is larger than or equal to a preset threshold value, the similarity between every two pictures in the sea scene class is also larger than or equal to the preset threshold value, and the similarity between every two pictures in the lake scene class is also larger than or equal to the preset threshold value.
For another example, when clustering the pictures of the plant category, the electronic device may calculate the similarity of every two pictures in the plant category, and then cluster the pictures of the plant category according to the similarity of every two pictures of the plant category, so as to obtain at least one cluster under the plant category, where the similarity between every two pictures included in the same cluster is greater than or equal to a preset threshold. For example, pictures in a plant scene category are clustered into 2 clusters, and the 2 clusters are pictures of a flower category, pictures of a tree category, and the like, respectively. The similarity between every two pictures in the flower category is larger than or equal to a preset threshold value, and the similarity between every two pictures in the tree category is also larger than or equal to the preset threshold value.
In one embodiment, the electronic device may create a corresponding folder or picture set for each cluster under each target category for storing the pictures contained in that cluster. For example, for pictures under the landscape category, the electronic device may create a folder for pictures of the mountain category (mountain cluster) for storing pictures of the mountain category, the electronic device may create a folder for pictures of the sea category (sea Jing Cu) for storing pictures of the sea category, and the electronic device may create a folder for pictures of the lake category (lake Jing Cu) for storing pictures of the lake category. For pictures under the plant category, the electronic device may create a folder for pictures of the flower category (flower cluster) for storing pictures of the flower category, the electronic device may create a folder for pictures of the tree category (tree cluster) for storing pictures of the tree category, and so on.
It can be understood that in the embodiment of the application, the electronic device may perform coarse classification on the pictures at first, and then perform clustering on the pictures of the target class on the basis of classification, so as to implement subdivision on the pictures. The subdivision of the pictures is beneficial to searching and browsing the pictures, so that the embodiment of the application can realize effective management of the pictures.
In one embodiment, when executing the process of performing the similarity calculation on each two pictures included in each target category in 204, the electronic device may include:
and the electronic equipment calculates the similarity of every two pictures contained in each target category by utilizing the twin neural network.
For example, the electronic device may utilize a twin neural network to calculate the similarity of every two pictures contained in each target category.
It should be noted that a twin neural Network (Siamese Network) may be used to measure the similarity of two inputs. The twin neural Network has two inputs (e.g., input 1 and Input 2, respectively) that are Input to two neural networks (e.g., network 1 and Network 2, respectively, where Network 1 and Network 2 may each be convolutional neural Network CNN, etc.), which may map the inputs to new spaces, respectively, to form representations of the inputs in the new spaces. The similarity of the two inputs can be evaluated by calculation of the Loss function Loss. When the neural networks used for training the two pictures are completely the same, the left network and the right network can realize all weight sharing. The twin neural network uses the contrast Loss as a Loss function, which can effectively process the relation of paired data in the twin neural network. The architecture of the twin neural network may be as shown in fig. 3.
In an embodiment, the twin neural network may be configured in a cloud device corresponding to the electronic device, where the cloud device may be a device deployed in the cloud for calculating a similarity between pictures.
Then, when the electronic device performs the above-mentioned process of performing similarity calculation on each two pictures included in each target category by using the twin neural network, the method may include:
the electronic equipment uploads the pictures contained in the target category to the cloud equipment;
the electronic equipment receives similarity information of every two pictures contained in each target category from the cloud equipment, wherein the similarity information is obtained by calculation through a twin neural network.
For example, a twin neural network for computing picture similarity may be deployed on a cloud device. After determining the target categories, the electronic device may upload the pictures included in each target category to the cloud device, so that the cloud device may use the twin neural network to perform similarity calculation on each two pictures included in each target category. After the similarity is calculated, the cloud device can feed the similarity information of every two pictures under each target category back to the electronic device.
It can be understood that, since the calculation of the similarity of the pictures has high requirements on resources such as the memory of the device, the calculation of the similarity of the pictures can be performed on the cloud device, so that the calculation resources of the electronic device are saved. When the similarity between the pictures needs to be calculated, the electronic equipment can upload the pictures needing to be calculated to the cloud equipment, and the cloud equipment calculates the similarity of the pictures by utilizing the configured twin neural network.
In one embodiment, the electronic device may upload the pictures included in each target category to the cloud device at a preset trigger time, and the cloud device calculates the similarity of each two pictures in the same target category. The preset trigger time may be a specific period of time when the device is in an idle state or at night, and so on.
206. The electronic equipment acquires the selected first picture, wherein the first picture is one picture in a plurality of pictures.
207. And according to the clustering result of each target class, the electronic equipment determines similar pictures of the first picture.
208. And the electronic equipment recommends similar pictures of the first picture.
For example, 206, 207, 208 may include:
after the electronic device classifies and clusters the pictures in the album, the pictures belonging to the same cluster may be considered as similar pictures to each other. Then, for example, when the user selects or collects a certain picture (i.e., the first picture) in the album, the electronic device may determine a similar picture of the first picture according to the clustering result of the pictures in the album, and recommend the similar picture of the first picture. For example, the electronic device may recommend 3 or 5 pictures with highest similarity among similar pictures of the first picture to the user. For example, when a certain flower picture is selected or collected by the user, the electronic device may determine 5 pictures most similar to the selected or collected flower picture from the pictures of the flower clusters, and recommend the pictures to the user, so that the user can browse and collect the similar pictures.
Referring to fig. 4 to 8, fig. 4 to 8 are schematic views of a picture processing method according to an embodiment of the present application.
For example, an album of an electronic device stores a plurality of pictures, and the electronic device may first acquire all the pictures in the album. Then, the electronic device can classify all pictures in the album by utilizing a lightweight picture classification algorithm MobileNet V2 which is subjected to learning training in advance. For example, the electronic device classifies all pictures in an album into a picture of a landscape category, a picture of a plant category, a picture of an animal category, and a picture of a vehicle category.
After classifying the pictures, the electronic device may create a corresponding folder for each category of pictures for storing the category of pictures. For example, the electronic device creates four folders, respectively landscape, plant, animal, and vehicle. Wherein, the folder of "landscape" is used for storing pictures of landscape categories, the folder of "plant" is used for storing pictures of plant categories, the folder of "animal" is used for storing pictures of animal categories, and the folder of "vehicle" is used for storing pictures of vehicle categories, as shown in fig. 4.
Then, the electronic device can acquire the number of the pictures of each category, and determine the target category by the category of which the number of the pictures reaches 30. For example, there are 50 pictures of landscape category, 35 pictures of plant category, 20 pictures of animal category, and 5 pictures of vehicle category. Then the electronic device may determine the scenery category and the plant category as target categories.
After determining the target category, the electronic device may perform clustering on the pictures of the scenery category, and perform clustering on the pictures of the plant category. The electronic device may upload the landscape type picture and the plant type picture to the cloud device when the electronic device is in a power-on state and may be connected to the network during a specific period of time, for example, 02:00-03:00. The cloud device is configured with a twin neural network, and the cloud device can calculate the similarity between two pictures by using the twin neural network. For example, upon receiving a picture of a landscape category and a picture of a plant category from an electronic device, the cloud device may calculate a similarity between every two pictures in the landscape category using a twin neural network. Then, the cloud device can calculate the similarity between every two pictures in the plant category by using the twin neural network. After the similarity is calculated, the cloud device may send the similarity information between every two pictures of the landscape type and the similarity information between every two pictures of the plant type to the electronic device.
After the electronic device receives the similarity information between every two pictures of the landscape category and the similarity information between every two pictures of the plant category, which are sent by the cloud device, clustering processing can be performed on the pictures of the landscape category and the pictures of the plant category according to the similarity information. When clustering the scenery-class pictures, the electronic device may cluster the scenery-class pictures according to the similarity of every two scenery-class pictures, so as to obtain at least one cluster under the scenery class, where the similarity between every two pictures contained in the same cluster is greater than or equal to a preset threshold. For example, pictures in a landscape category are clustered into 3 clusters, and the 3 clusters are a picture of a mountain category, a picture of a sea category, a picture of a lake category, and the like, respectively. The similarity between every two pictures in the mountain class is larger than or equal to a preset threshold value, the similarity between every two pictures in the sea scene class is also larger than or equal to the preset threshold value, and the similarity between every two pictures in the lake scene class is also larger than or equal to the preset threshold value.
For another example, when clustering the pictures of the plant category, the electronic device may cluster the pictures of the plant category according to the similarity of the pictures of each two plant categories, so as to obtain at least one cluster under the plant category, where the similarity between every two pictures included in the same cluster is greater than or equal to a preset threshold. For example, pictures in a plant scene category are clustered into 2 clusters, and the 2 clusters are pictures of a flower category, pictures of a tree category, and the like, respectively. The similarity between every two pictures in the flower category is larger than or equal to a preset threshold value, and the similarity between every two pictures in the tree category is also larger than or equal to the preset threshold value.
For example, in the embodiment of the present application, the electronic device may create 3 subfolders under the folder corresponding to the landscape category, which are respectively a peak, a sea view, and a lake view, where the subfolders "peak" are used for storing pictures of the peak category, the subfolders "sea view" are used for storing pictures of the sea view category, and the subfolders "lake view" are used for storing pictures of the lake view category, as shown in fig. 5.
The electronic device may create 2 subfolders, namely flowers and trees, under the folders corresponding to the plant categories, where the subfolders "flowers" are used for storing pictures of the flower categories, and the subfolders "trees" are used for storing pictures of the tree categories, as shown in fig. 6.
Some time later, for example, the user feels that a picture of a peak category is taken particularly well when browsing this picture, and thus clicks "favorite" to collect this picture, as shown in fig. 7. After detecting that the user collects the picture A of the peak category, the electronic device can search 3 pictures with highest similarity with the picture A from the subfolder 'peak', and recommend the 3 similar pictures to the user. For example, 3 pictures with the highest similarity to picture a in the subfolder "mountain" are B, C, D respectively. Then the electronic device may recommend these 3 pictures B, C, D to the user as shown in fig. 8.
It can be appreciated that the embodiment of the application can realize subdivision of the pictures in the album, and recommend several pictures which are most similar to the user when the user collects the pictures. Therefore, the method and the device can improve the effectiveness and the intelligence of album management.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a picture processing device according to an embodiment of the present application. The picture processing apparatus 300 may include: the device comprises an acquisition module 301, a classification module 302, a determination module 303 and a clustering module 304.
The acquiring module 301 is configured to acquire a plurality of pictures.
The classifying module 302 is configured to classify the plurality of pictures to obtain at least one category.
A determining module 303, configured to determine a target category that meets a preset condition from the at least one category.
And the clustering module 304 is configured to cluster the pictures included in each target category to obtain a clustering result of each target category.
In one embodiment, the clustering module 304 may be configured to:
performing similarity calculation on each two pictures contained in each target category to obtain the similarity of each two pictures contained in each target category;
clustering is carried out according to the similarity of every two pictures contained in each target category, and at least one cluster under each target category is obtained, wherein the similarity between every two pictures contained in the same cluster is larger than or equal to a preset threshold value.
In one embodiment, the clustering module 304 may also be configured to:
acquiring a selected first picture, wherein the first picture is one picture in the plurality of pictures;
according to the clustering result of each target class, determining similar pictures of the first picture;
and recommending the similar pictures of the first picture.
In one embodiment, the clustering module 304 may be configured to:
and calculating the similarity of each two pictures contained in each target category by utilizing the twin neural network.
In one embodiment, the twin neural network is configured in a cloud device corresponding to the electronic device, where the cloud device is a device deployed in the cloud for calculating similarity between pictures.
Then, the clustering module 304 may be configured to:
uploading the pictures contained in the target category to the cloud device;
and receiving similarity information of every two pictures contained in each target category from the cloud device, wherein the similarity information is calculated by utilizing a twin neural network.
In one embodiment, the determining module 303 may be configured to:
and determining a target class meeting a preset condition from the at least one class, wherein the target class meeting the preset condition is a class containing pictures with the number larger than or equal to a preset numerical value.
In one embodiment, the classification module 302 may be configured to:
and classifying the plurality of pictures by using a lightweight picture classification algorithm to obtain at least one category.
The present embodiment provides a computer-readable storage medium having stored thereon a computer program which, when executed on a computer, causes the computer to perform the flow in the method as provided in the present embodiment.
The embodiment of the application also provides electronic equipment, which comprises a memory and a processor, wherein the processor is used for executing the flow in the picture processing method provided by the embodiment by calling the computer program stored in the memory.
For example, the electronic device may be a mobile terminal such as a tablet computer or a smart phone. Referring to fig. 10, fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
The electronic device 400 may include a touch display 401, memory 402, processor 403, and the like. It will be appreciated by those skilled in the art that the electronic device structure shown in fig. 10 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The touch display 401 may be used to display information such as images, text, and the like, and may also be used to receive a touch operation by a user.
Memory 402 may be used to store applications and data. The memory 402 stores application programs including executable code. Applications may constitute various functional modules. Processor 403 executes various functional applications and data processing by running application programs stored in memory 402.
The processor 403 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing application programs stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device.
In this embodiment, the processor 403 in the electronic device loads executable codes corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 403 executes the application programs stored in the memory 402, so as to execute:
acquiring a plurality of pictures;
classifying the plurality of pictures to obtain at least one category;
determining a target category meeting preset conditions from the at least one category;
and clustering the pictures contained in each target category to obtain a clustering result of each target category.
Referring to fig. 11, an electronic device 400 may include a touch display 401, a memory 402, a processor 403, a battery 404, a microphone 405, a speaker 406, and the like.
The touch display 401 may be used to display information such as images, text, and the like, and may also be used to receive a touch operation by a user.
Memory 402 may be used to store applications and data. The memory 402 stores application programs including executable code. Applications may constitute various functional modules. Processor 403 executes various functional applications and data processing by running application programs stored in memory 402.
The processor 403 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing application programs stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device.
The battery 404 may be used to supply power to the various modules and components of the electronic device.
The microphone 405 may be used to pick up sound signals in the surrounding environment, e.g. to receive voice commands from a user, etc.
The speaker 406 may be used to play sound signals.
In this embodiment, the processor 403 in the electronic device loads executable codes corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 403 executes the application programs stored in the memory 402, so as to execute:
acquiring a plurality of pictures;
classifying the plurality of pictures to obtain at least one category;
determining a target category meeting preset conditions from the at least one category;
and clustering the pictures contained in each target category to obtain a clustering result of each target category.
In one embodiment, when the processor 403 performs the clustering on the pictures included in each target category to obtain a clustering result of each target category, the method may be performed: performing similarity calculation on each two pictures contained in each target category to obtain the similarity of each two pictures contained in each target category; clustering is carried out according to the similarity of every two pictures contained in each target category, and at least one cluster under each target category is obtained, wherein the similarity between every two pictures contained in the same cluster is larger than or equal to a preset threshold value.
In one embodiment, the processor 403 may also perform: acquiring a selected first picture, wherein the first picture is one picture in the plurality of pictures; according to the clustering result of each target class, determining similar pictures of the first picture; and recommending the similar pictures of the first picture.
In one embodiment, when the processor 403 performs the similarity calculation for each two pictures included in each target category, the method may be performed: and calculating the similarity of each two pictures contained in each target category by utilizing the twin neural network.
In one embodiment, the twin neural network is configured in a cloud device corresponding to the electronic device, where the cloud device is a device deployed in the cloud for calculating similarity between pictures.
Then, when the processor 403 performs the similarity calculation on each two pictures included in each target category using the twin neural network, it may perform: uploading the pictures contained in the target category to the cloud device; and receiving similarity information of every two pictures contained in each target category from the cloud device, wherein the similarity information is calculated by utilizing a twin neural network.
In one embodiment, when the processor 403 executes the determination of the target category that meets the preset condition from the at least one category, the method may be executed: and determining a target class meeting a preset condition from the at least one class, wherein the target class meeting the preset condition is a class containing pictures with the number larger than or equal to a preset numerical value.
In one embodiment, when the processor 403 performs the classifying the plurality of pictures to obtain at least one category, the method may perform: and classifying the plurality of pictures by using a lightweight picture classification algorithm to obtain at least one category.
In the foregoing embodiments, the descriptions of the embodiments are focused on, and the portions of a certain embodiment that are not described in detail may be referred to the detailed description of the picture processing method, which is not repeated herein.
The image processing device provided in the embodiment of the present application and the image processing method in the foregoing embodiment belong to the same concept, and any method provided in the embodiment of the image processing method may be run on the image processing device, and a detailed implementation process of the method is shown in the embodiment of the image processing method, which is not repeated herein.
It should be noted that, for the image processing method according to the embodiment of the present application, it will be understood by those skilled in the art that all or part of the flow of implementing the image processing method according to the embodiment of the present application may be implemented by controlling related hardware through a computer program, where the computer program may be stored in a computer readable storage medium, such as a memory, and executed by at least one processor, and the execution may include the flow of the embodiment of the image processing method as described in the embodiment of the present application. The storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a random access Memory (RAM, random Access Memory), etc.
For the image processing device in the embodiment of the present application, each functional module may be integrated in one processing chip, or each module may exist separately and physically, or two or more modules may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated module, if implemented as a software functional module and sold or used as a stand-alone product, may also be stored on a computer readable storage medium such as read-only memory, magnetic or optical disk, etc.
The foregoing describes in detail a picture processing method, apparatus, storage medium and electronic device provided in the embodiments of the present application, and specific examples are applied to illustrate principles and implementations of the present application, where the foregoing description of the embodiments is only used to help understand the method and core idea of the present application; meanwhile, those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, and the present description should not be construed as limiting the present application in view of the above.
Claims (6)
1. A picture processing method applied to an electronic device, the method comprising:
acquiring a plurality of pictures;
classifying the plurality of pictures by adopting a lightweight picture classification algorithm to obtain at least one category;
creating a corresponding folder or picture set for each category of pictures for storing the pictures of the category;
determining a target category meeting preset conditions from the at least one category; the target category meeting the preset condition is a category containing pictures with the number of the pictures being larger than or equal to a preset numerical value;
clustering pictures contained in each target category by utilizing a twin neural network to obtain a clustering result of each target category; comprising the following steps: calculating the similarity of each two pictures contained in each target category by utilizing a twin neural network; clustering according to the similarity of every two pictures contained in each target category to obtain at least one cluster under each target category;
creating a corresponding folder or picture set for each cluster under each target category for storing pictures contained in the cluster;
acquiring a selected first picture, wherein the first picture is one picture in the plurality of pictures;
according to the clustering result of each target category, determining similar pictures of the first picture from clusters under the target category;
and recommending the similar pictures of the first picture.
2. The picture processing method according to claim 1, wherein the similarity between every two pictures included in the same cluster is greater than or equal to a preset threshold.
3. The picture processing method according to claim 1, wherein the twin neural network is configured in a cloud device corresponding to the electronic device, the cloud device being a device for calculating similarity between pictures deployed in a cloud;
the calculating the similarity of each two pictures contained in each target category by using the twin neural network comprises the following steps:
uploading the pictures contained in the target category to the cloud device;
and receiving similarity information of every two pictures contained in each target category from the cloud device, wherein the similarity information is calculated by utilizing a twin neural network.
4. A picture processing apparatus applied to an electronic device, the apparatus comprising:
the acquisition module is used for acquiring a plurality of pictures;
the classification module is used for classifying the plurality of pictures by adopting a lightweight picture classification algorithm to obtain at least one category;
the category creation module is used for creating a corresponding folder or a picture set for each category of pictures and storing the pictures of the category;
the determining module is used for determining a target category meeting preset conditions from the at least one category; the target category meeting the preset condition is a category containing pictures with the number of the pictures being larger than or equal to a preset numerical value;
the clustering module is used for clustering pictures contained in each target category by utilizing the twin neural network to obtain a clustering result of each target category; the method is particularly used for: calculating the similarity of each two pictures contained in each target category by utilizing a twin neural network; clustering according to the similarity of every two pictures contained in each target category to obtain at least one cluster under each target category;
the cluster creation module is used for creating a corresponding folder or picture set for each cluster under each target category and storing pictures contained in the cluster;
the clustering module is further configured to obtain a selected first picture, where the first picture is one picture of the multiple pictures; according to the clustering result of each target category, determining similar pictures of the first picture from clusters under the target category; and recommending the similar pictures of the first picture.
5. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when executed on a computer, causes the computer to perform the method of any one of claims 1 to 3.
6. An electronic device comprising a memory, a processor, wherein the processor executes the method of any of claims 1 to 3 by invoking a computer program stored in the memory.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010225852.6A CN111460195B (en) | 2020-03-26 | 2020-03-26 | Picture processing method and device, storage medium and electronic equipment |
PCT/CN2021/074955 WO2021190165A1 (en) | 2020-03-26 | 2021-02-03 | Picture processing method and apparatus, and storage medium and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010225852.6A CN111460195B (en) | 2020-03-26 | 2020-03-26 | Picture processing method and device, storage medium and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111460195A CN111460195A (en) | 2020-07-28 |
CN111460195B true CN111460195B (en) | 2023-08-01 |
Family
ID=71682475
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010225852.6A Active CN111460195B (en) | 2020-03-26 | 2020-03-26 | Picture processing method and device, storage medium and electronic equipment |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111460195B (en) |
WO (1) | WO2021190165A1 (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111460195B (en) * | 2020-03-26 | 2023-08-01 | Oppo广东移动通信有限公司 | Picture processing method and device, storage medium and electronic equipment |
CN112199451B (en) * | 2020-09-30 | 2024-07-16 | 京东科技控股股份有限公司 | Commodity identification method, commodity identification device, computer equipment and storage medium |
CN113887680A (en) * | 2021-12-08 | 2022-01-04 | 智道网联科技(北京)有限公司 | Method for testing training model data, electronic device, and storage medium |
CN114416647A (en) * | 2022-01-21 | 2022-04-29 | 京东方科技集团股份有限公司 | Picture processing method, electronic device and computer readable medium |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110222728A (en) * | 2019-05-15 | 2019-09-10 | 图灵深视(南京)科技有限公司 | The training method of article discrimination model, system and article discrimination method, equipment |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10346466B2 (en) * | 2016-04-18 | 2019-07-09 | International Business Machines Corporation | Methods and systems of personalized photo albums based on social media data |
JP6765667B2 (en) * | 2016-07-13 | 2020-10-07 | 国立大学法人京都大学 | Cluster evaluation device, cluster number calculation device, cluster device, cluster evaluation method, and program |
CN108388888B (en) * | 2018-03-23 | 2022-04-05 | 腾讯科技(深圳)有限公司 | Vehicle identification method and device and storage medium |
CN109063737A (en) * | 2018-07-03 | 2018-12-21 | Oppo广东移动通信有限公司 | Image processing method, device, storage medium and mobile terminal |
CN110490237B (en) * | 2019-08-02 | 2022-05-17 | Oppo广东移动通信有限公司 | Data processing method and device, storage medium and electronic equipment |
CN110472082B (en) * | 2019-08-02 | 2022-04-01 | Oppo广东移动通信有限公司 | Data processing method, data processing device, storage medium and electronic equipment |
CN111460195B (en) * | 2020-03-26 | 2023-08-01 | Oppo广东移动通信有限公司 | Picture processing method and device, storage medium and electronic equipment |
-
2020
- 2020-03-26 CN CN202010225852.6A patent/CN111460195B/en active Active
-
2021
- 2021-02-03 WO PCT/CN2021/074955 patent/WO2021190165A1/en active Application Filing
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110222728A (en) * | 2019-05-15 | 2019-09-10 | 图灵深视(南京)科技有限公司 | The training method of article discrimination model, system and article discrimination method, equipment |
Also Published As
Publication number | Publication date |
---|---|
CN111460195A (en) | 2020-07-28 |
WO2021190165A1 (en) | 2021-09-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111460195B (en) | Picture processing method and device, storage medium and electronic equipment | |
CN111368893B (en) | Image recognition method, device, electronic equipment and storage medium | |
US11238310B2 (en) | Training data acquisition method and device, server and storage medium | |
CN106355170B (en) | Photo classification method and device | |
US10140515B1 (en) | Image recognition and classification techniques for selecting image and audio data | |
US7809185B2 (en) | Extracting dominant colors from images using classification techniques | |
US20170140029A1 (en) | System and method for clustering multimedia content elements | |
EP2402867B1 (en) | A computer-implemented method, a computer program product and a computer system for image processing | |
CN111209970B (en) | Video classification method, device, storage medium and server | |
WO2019127832A1 (en) | Intelligent search method and apparatus, terminal, server, and storage medium | |
WO2012073421A1 (en) | Image classification device, image classification method, program, recording media, integrated circuit, and model creation device | |
WO2022121485A1 (en) | Image multi-tag classification method and apparatus, computer device, and storage medium | |
US10380256B2 (en) | Technologies for automated context-aware media curation | |
US10013639B1 (en) | Analyzing digital images based on criteria | |
CN112328823A (en) | Training method and device for multi-label classification model, electronic equipment and storage medium | |
CN111027622B (en) | Picture label generation method, device, computer equipment and storage medium | |
CN110049180A (en) | Shoot posture method for pushing and device, intelligent terminal | |
JP2018169972A (en) | Object detection device, detection model generator, program, and method capable of learning based on search result | |
JP2014092955A (en) | Similar content search processing device, similar content search processing method and program | |
CN112580750A (en) | Image recognition method and device, electronic equipment and storage medium | |
CN107704471A (en) | A kind of information processing method and device and file call method and device | |
CN112069338A (en) | Picture processing method and device, electronic equipment and storage medium | |
CN111782945B (en) | Book searching method, computing device and storage medium | |
US20170255619A1 (en) | System and methods for determining access permissions on personalized clusters of multimedia content elements | |
CN114741549A (en) | Image duplicate checking method and device based on LIRE, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |