WO2025156293A1 - Light-effect control method and apparatus, and electronic device and storage medium - Google Patents
Light-effect control method and apparatus, and electronic device and storage mediumInfo
- Publication number
- WO2025156293A1 WO2025156293A1 PCT/CN2024/074329 CN2024074329W WO2025156293A1 WO 2025156293 A1 WO2025156293 A1 WO 2025156293A1 CN 2024074329 W CN2024074329 W CN 2024074329W WO 2025156293 A1 WO2025156293 A1 WO 2025156293A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- lighting
- user information
- static
- static image
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/50—Lighting effects
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/50—Image enhancement or restoration using two or more images, e.g. averaging or subtraction
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- H—ELECTRICITY
- H05—ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
- H05B—ELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
- H05B47/00—Circuit arrangements for operating light sources in general, i.e. where the type of light source is not relevant
- H05B47/10—Controlling the light source
Definitions
- the present application relates to the field of lighting technology, and in particular to a lighting effect control method, device, electronic device, and storage medium.
- the present application provides a lighting effect control method, which includes: obtaining user information, generating a static image or a dynamic image based on the user information, and controlling the lighting effect of a lighting device based on the static image or the dynamic image.
- the user information includes at least one of text, video, image and sound.
- generating a static image or a dynamic image based on the user information includes: if the user information includes theme information, generating a static image or a dynamic image of the theme corresponding to the theme information according to a preset style; if the user information includes theme information and style information, generating a static image or a dynamic image of the theme corresponding to the theme information according to the style corresponding to the style information.
- generating a static image or a dynamic image based on the user information includes: processing the user information based on artificial intelligence content generation technology to generate the static image or the dynamic image.
- the processing of the user information based on artificial intelligence content generation technology to generate the static image or the dynamic image includes: inputting the user information into a diffusion model to generate the static image or the dynamic image.
- the method further includes: performing pixelation processing on the static image or the dynamic image, and controlling the lighting effect of the lighting device according to the pixelated static image or dynamic image.
- the pixelation processing of the static image or the dynamic image includes: In summary: pixelating the static image or the dynamic image based on an image translation neural network model.
- controlling the lighting effects of the lighting device based on the static image includes: controlling the lighting effects of each of the lighting devices or each light-emitting element in the lighting device based on the pixel value of each pixel in the static image, or controlling the lighting effects of each of the lighting devices or each light-emitting element in the lighting device based on the pixel values of multiple pixels in the static image.
- the present application provides a lighting effect control device that runs on an electronic device, and the lighting effect control device includes: an acquisition unit for acquiring user information, a generation unit for generating a static image or a dynamic image based on the user information, and a control unit for controlling the lighting effect of the lighting device based on the static image or the dynamic image.
- the present application provides an electronic device, which includes: a memory storing at least one instruction; and a processor executing at least one instruction to implement the lighting effect control method.
- the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores at least one instruction, and the at least one instruction is executed by a processor in an electronic device to implement the lighting effect control method.
- user information is obtained. Since user information can reflect the user's lighting effect requirements, static or dynamic images that meet the user's needs can be flexibly generated based on the user information, thereby accurately controlling the lighting device. Furthermore, due to the accurate control of the lighting device, dynamic images can provide richer lighting effects, thereby improving the user experience.
- FIG1 is a diagram showing an application scenario of a lighting device control method provided in an embodiment of the present application.
- FIG2 is a flow chart of a lighting effect control method provided in an embodiment of the present application.
- FIG3 is a schematic diagram of a realistic-style static image provided by an embodiment of the present application.
- FIG4 is a schematic diagram of a pixel-style static image provided by an embodiment of the present application.
- FIG5 is a flowchart of a method for training a diffusion model according to an embodiment of the present application.
- FIG6 is a flowchart of a method for controlling lighting effects provided in another embodiment of the present application.
- FIG7 is a flowchart of a method for training an image translation neural network model according to an embodiment of the present application.
- FIG8 is a functional module diagram of a lighting effect control device provided in an embodiment of the present application.
- FIG9 is a schematic structural diagram of an electronic device provided in one embodiment of the present application.
- words such as “exemplary” or “for example” are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as “exemplary” or “for example” in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as “exemplary” or “for example” is intended to present the relevant concepts in a concrete manner.
- the present application provides a lighting effect control method, apparatus, electronic device, and storage medium that can accurately control lighting equipment and provide richer lighting effects, thereby improving user experience.
- the lighting control method provided in the embodiments of the present application can be executed by one or more electronic devices.
- FIG 1 it is an application scenario diagram of the lighting device control method provided by an embodiment of the present application.
- an electronic device 10 communicates with multiple lighting devices 20 respectively, and Figure 1 only shows one lighting device.
- the lighting device 20 in Figure 1 is a light string, which constitutes a curtain light.
- the curtain light shows a pixel-style pumpkin element, and the lighting effect (lighting effect) of the lamp beads on the curtain light can also be synchronized with the sound (such as music), so that the lighting effect is more in line with the scene.
- the lighting device 20 can be various types of lamps that can provide lighting functions.
- the lighting device 20 can also be an LED lamp, an energy-saving lamp, a floodlight, a security lamp, a light strip, and an eaves lamp.
- the light string is composed of a plurality of lamp beads, each of which has an integrated circuit integrated in it. Through a signal line, the controller connects the integrated circuits of all the lamp beads in the light string in series, thereby realizing control of the entire light string.
- the electronic device 10 in Figure 1 is a mobile phone. Besides the mobile phone shown in Figure 1 , the electronic device 10 may also be a tablet computer, a laptop computer, or a computer. The present embodiment does not impose any restrictions on the specific type of the electronic device 10.
- the electronic device 10 can connect to multiple lighting devices 20 via Bluetooth, hotspots, Wi-Fi, or other methods, thereby enabling the electronic device 10 to control the multiple lighting devices 20.
- FIG2 is a flowchart of a lighting effect control method according to an embodiment of the present application.
- the order of the steps in the flowchart may be adjusted based on different needs, and some steps may be omitted.
- the method is performed by an electronic device, such as the electronic device 10 shown in FIG1 .
- user information includes at least one of text, video, image and sound
- the sound may include various file formats such as instant voice and audio files, and the sound may be sound effects, voice and music, etc.
- the images in the user information include various image formats such as static images and dynamic images (such as images in GIF format).
- User information may include text, video, image and sound input by the user, and the user information may be obtained in various ways such as the user typing on the keyboard, the user handwriting input on the interactive interface of the electronic device, the electronic device converting the voice recorded by the microphone, or the electronic device parsing the image, and the present application does not impose any restrictions on this.
- user information includes theme information, or user information includes theme information and style information
- the theme information is used to control the theme of the static image or dynamic image below
- the style information is used to control the style of the static image or dynamic image.
- the theme can be the image content in the static image or dynamic image
- the style can be the visual style of the static image or dynamic image.
- Themes include but are not limited to: festivals, daily life, hobbies, natural scenery, and entertainment.
- festivals can include the Spring Festival, Mid-Autumn Festival, Christmas, Thanksgiving, and Halloween, etc.
- daily life can include family life, work scenes, and school life, etc.
- hobbies can be reading, Music, painting, photography, fitness and travel, etc.
- Entertainment can include games, sports, film and television, animation and celebrities, etc.
- Styles include, but are not limited to, realistic style and pixel style.
- Realistic style is a form of expression that pursues realism, and strives to reproduce real-life scenes and characters through detailed depiction and realistic expression techniques.
- Realistic-style images are characterized by clear textures, realistic pictures, rich and natural colors, delicate brushstrokes, and realistic light and shadow, presenting a realistic visual effect.
- Pixel style is a form of expression that uses pixels to express characters or scenes, and presents a pixelated effect by decomposing the image into pixels.
- Pixel-style images are characterized by bright colors, simplified details, a retro feel, and a sense of dynamism. They express the characteristics of the object through concise lines and shapes, and use high-contrast colors to express the theme of the picture. They usually use low-resolution image elements, simple image elements, and bright colors.
- the electronic device can convert the sound information in the user information into text information, decouple the dynamic images and/or videos in the user information into multi-frame images, and generate a static image or dynamic image corresponding to the user information through the converted text and/or multi-frame images.
- one category of user information may include only subject information, or may include both subject information and style information.
- the text information may include only subject information, or may include both subject information and style information.
- Multiple categories of user information may include only subject information, or may include both subject information and style information.
- the user information includes text information and image information
- the text information and the image information may include only subject information, or the text information and the image information may include both subject information and style information.
- the text information and the image information include both subject information and style information
- the text information may include style information and the image information may include subject information
- the text information may include subject information and the image information may include style information
- both the text information and the image information may include subject information and style information.
- a dynamic image refers to an image that includes a dynamically changing effect.
- a dynamic image can display a process or multiple consecutive static images.
- the user information includes a video
- the user information includes multiple consecutive frames of images, or the user information includes text information describing a dynamic process
- the video or dynamic image can be directly obtained based on the user information.
- a video can be first generated based on the user information, and then multiple frames of images can be selected from the generated video to synthesize the dynamic image.
- the number of selected images can be set arbitrarily and is not limited by this application.
- the electronic device generating a static image or dynamic image based on user information includes: when the user information includes theme information, the electronic device generating a static image or dynamic image corresponding to the theme and a preset style based on the user information; or, when the user information includes theme information and style information, the electronic device generating a static image or dynamic image based on the user information includes: the electronic device generating a static image or dynamic image corresponding to the theme and a corresponding style based on the user information.
- the preset style can be set by the user, and this application does not limit this.
- the preset style can be a realistic style or a pixel style.
- the electronic device processes user information based on artificial intelligence-generated content (AI-Generated Content, AIGC) technology to generate static or dynamic images with a theme and/or style.
- AI-Generated Content AI-Generated Content
- the AI-generated content technology can be customized and is not limited in this application.
- the AI-generated content technology can be a trained diffusion model (Diffusion or Stable Diffusion) or ChatGPT.
- the diffusion model includes a text encoder model (Text Encoder), an image information generator model (Image Generator) and an autoencoder (AutoEncoder).
- the text encoder model can be a CLIP model
- the image generator model can include a Unet network and a sampler algorithm
- the autoencoder can be AutoEncoderKL. Since the diffusion model includes a text encoder model, the input information of the diffusion model includes text information.
- the network architecture of the diffusion model can also be implemented using an attention mechanism and a convolutional neural network.
- the above method for implementing the diffusion model architecture is only an example. In actual applications, the network architecture of the diffusion model can also be implemented using other methods.
- the electronic device inputs the user information into the trained diffusion model to obtain a static image, including: the electronic device calls the text encoder model to encode the user information into a text embedding vector, the electronic device calls the latent seed (Latent Seed) to generate an image information tensor, the text embedding vector and the image information tensor are input into the image information generator model to obtain a first image latent vector, the image information tensor is iterated using the first image latent vector to obtain a first image latent vector corresponding to a preset number of iterations, the electronic device calls the image decoder (Image Decoder) in the autoencoder to decode the first image latent vector corresponding to the preset number of iterations to obtain a static image of the corresponding theme and style.
- the preset number of iterations can be set voluntarily, and this application does not impose any restrictions on this. For example, the preset number of iterations can be set voluntarily, and this application does not impose any restrictions on this. For example,
- the preset style is realistic
- the user information is text information: a Christmas-themed photo, Santa Claus is standing in front of a house with a smile on his face and a Christmas gift hanging on his face.
- the text information can be obtained in a variety of ways, such as the user typing on the keyboard, the user handwriting input on the interactive interface of the electronic device, the electronic device converting the voice recorded by the microphone, or the electronic device parsing the image.
- the theme of the static image indicated by the user information is Christmas theme, and the style of the generated static image is not indicated.
- the electronic device can call the diffusion model to generate a realistic-style static image, as shown in Figure 3, which is a schematic diagram of a realistic-style static image provided by an embodiment of the present application.
- the realistic-style static image shown in Figure 3 includes Santa Claus wearing a Santa hat, a Christmas suit, holding Christmas gifts in both hands, and a smile on his face.
- the realistic-style static image shown in Figure 3 has the characteristics of clear texture, realistic picture, delicate brushstrokes, and realistic light and shadow.
- the electronic device inputs the user information into the trained diffusion model to obtain a static image, including: the electronic device calls the text encoder model to encode the text information in the user information into a text embedding vector, the electronic device calls the image encoder (Image Encoder) in the autoencoder to encode the image information in the user information into an image embedding vector, inputs the text embedding vector and the image embedding vector into the image information generator model to obtain a second image latent vector, uses the second image latent vector to iterate the image embedding vector to obtain a second image latent vector corresponding to a preset number of iterations, and the electronic device calls the image decoder in the autoencoder to decode the second image latent vector corresponding to the preset number of iterations to obtain a static image of the corresponding theme and corresponding style.
- the image encoder Image Encoder
- the user information is text information: a pixelated photo with a Christmas theme, Santa Claus is standing in front of a house with a smile on his face and a Christmas gift hanging on his face.
- the text information can be obtained in a variety of ways, such as the user typing on the keyboard, the user handwriting in the interactive interface of the electronic device, the electronic device converting the voice recorded by the microphone, or the electronic device parsing the image.
- the user information indicates that the theme of the generated static image is a Christmas theme, and indicates that the style of the generated static image is a pixel style.
- the electronic device can call the diffusion model to generate a pixel-style static image. As shown in Figure 4, it is a schematic diagram of a pixel-style static image provided by an embodiment of the present application.
- the pixel-style static image shown in Figure 4 includes Santa Claus wearing a Santa hat, a Christmas suit, holding Christmas gifts in both hands, and a smile on his face.
- the pixel-style static image shown in Figure 4 presents a pixelated The effect is characterized by simplified details, retro feel and dynamic feeling.
- the electronic device inputs the multiple frames of the dynamic images and/or videos in the user information into the diffusion model to obtain a static image corresponding to each frame of the image, and synthesizes the static images corresponding to the multiple frames of the image to obtain a dynamic image corresponding to the theme and the corresponding style.
- the method for generating the static image corresponding to each frame of the image can refer to the method for generating the static image in the example, and will not be repeated in this application.
- the generation method of static images or dynamic images corresponding to the theme and preset style can refer to the above examples, and this application will not explain them one by one.
- artificial intelligence content generation technology in order to improve the operating efficiency of electronic devices, artificial intelligence content generation technology can be deployed in devices such as servers, cloud or cloud servers, and electronic devices can communicate with devices such as servers, cloud or cloud servers through Bluetooth, hotspots, Wi-Fi, etc., so as to obtain static images or dynamic images generated by artificial intelligence content generation technology.
- the electronic device can send the user information to devices such as servers, cloud or cloud servers, and receive images sent from devices such as servers, cloud or cloud servers as static images or dynamic images.
- the server, cloud or cloud server can store diffusion models corresponding to multiple styles. When receiving user information sent from the electronic device, the corresponding diffusion model can be called to generate a static image or dynamic image of the style indicated by the user information.
- the user information when the user information includes theme information and style information, a static image or dynamic image that meets the user's needs can be accurately generated. Since the user information can be set by the user, the generation of static images and dynamic images is flexible.
- the electronic device controls the lighting effects of a lighting device based on a static image, including: the electronic device controls the lighting effects of each lighting device or each light-emitting element in the lighting device based on the pixel value of each pixel point in the static image, or controls the lighting effects of each lighting device or each light-emitting element in the lighting device based on the pixel values of multiple pixels in the static image.
- lighting devices can include light strings, energy-saving lamps, floodlights, security lights, light strips, and eaves lights.
- a lighting device can be composed of multiple light-emitting elements. For example, if the lighting device is a light string composed of multiple lamp beads, a light-emitting element is one of the lamp beads in the light string.
- the pixel value of each pixel in a static image can control the lighting effect of a lighting device or a light-emitting element in a lighting device.
- a static image includes the pixel values of multiple pixels
- the pixel values of multiple pixels in the static image can be used to control the lighting effect of each lighting device or each light-emitting element in the lighting device.
- the electronic device can average or weighted average the pixel values of multiple pixels, and control the lighting effect of a lighting device or a light-emitting element in the lighting device according to the averaged or weighted averaged pixel values.
- the number of multiple pixels to be averaged or weighted averaged can be set voluntarily, and this application does not impose any restrictions on this.
- the static image or dynamic image can be divided into regions, and the pixel values of the pixels in each region after the division can be weighted averaged or averaged, wherein a pre-trained image segmentation model can be used to divide the static image or dynamic image into regions, and the number of pixels in different regions is different.
- the pixels in different regions can be averaged or weighted averaged, and the lighting effect of a lighting device or a light-emitting element in the lighting device can be controlled according to the averaged or weighted averaged pixel values.
- the number of pixels in each region can be set voluntarily. The present application does not impose any restrictions on this.
- the lighting device is a light string
- the light-emitting element can be one of the lamp beads in the light string.
- the generated static image or dynamic image can use different color spaces, including RGB (red, green, blue) color space, HSL (hue, saturation, brightness) or HSV (hue, saturation, value) and other color spaces.
- the electronic device can convert the static image or dynamic image from the HSL or HSV color space to the RGB color space, and then control the lighting effects of the lighting device based on the static image or dynamic image in RGB format obtained after the conversion.
- the pixel value obtained by averaging or weighted averaging multiple pixels in each area of the static image can control the lighting effects of a lighting device or a light-emitting element in the lighting device.
- the static image can be divided into multiple areas, when there are multiple lighting devices or the lighting device is composed of multiple light-emitting elements, the pixel values of the multiple pixels included in the static image can be used to control the lighting effects of each lighting device or each light-emitting element in the lighting device.
- each pixel value of a static image or dynamic image in RGB format is composed of three components: red (Red), green (Green), and blue (Blue)
- the pixel value of a static image or dynamic image in RGB format is also called an RGB value.
- a lighting device or each light-emitting element includes light-emitting bodies corresponding to the three colors of red, green, and blue.
- the light-emitting body can be a light-emitting diode (LED).
- the electronic device distributes the red, green, and blue components of each pixel value to the corresponding light-emitting body in the lighting device or each light-emitting element, so that the lighting device or light-emitting element can emit a lighting effect corresponding to the static image.
- the electronic device can control the lighting effects of the lighting device in sequence according to each frame of the image, so that the lighting device emits a dynamic lighting effect.
- the process of controlling the lighting effects of the lighting device according to each frame of the dynamic image is basically the same as the above-mentioned process of controlling the lighting effects of the lighting device according to the static image.
- the process of controlling the lighting effects of the lighting device according to the dynamic image is similar to the process of controlling the lighting effects of the lighting device according to the static image, so this application will not repeat the description.
- the electronic device can control the lighting effects of the lighting device based on the static image, dynamic image, and sound information in the user information.
- the electronic device distributes the red, green, and blue components of each pixel value to the corresponding light source in each lighting device or each light-emitting element, causing the lighting device or light-emitting element to emit the corresponding light.
- the electronic device also controls the light to produce light-changing effects such as slow flow, flashing, gradual change, and sweeping according to the rhythm of the music and/or sound effects, so that the lighting effects of the lighting device or light-emitting element better meet the user's needs.
- the electronic device when the resolution of a static image or a dynamic image does not match the number of lighting devices, can scale the static image and/or the dynamic image according to the number of lighting devices. For example, if the lighting device is a light string, the number of lamp beads is 520, and the resolution of the static image and/or the dynamic image is 512x512, the electronic device can downsample the static image and/or the dynamic image with a resolution of 512x512 to 26x20 through a nearest neighbor downsampling algorithm, thereby obtaining a static image and/or a dynamic image with a resolution of 26x20, and control the lighting effects of the 520 lamp beads according to the static image and/or the dynamic image with a resolution of 26x20.
- the downsampling method can be nearest neighbor interpolation, bilinear interpolation, etc.
- the resolution of an image refers to the number of pixels included in the image, usually expressed as the number of horizontal pixels x the number of vertical pixels.
- an image with a resolution of 480x800 is composed of 480 pixels in the horizontal direction and 800 pixels in the vertical direction (a total of 384,000 pixels).
- the generated video or dynamic image generated according to the user information can be encoded and compressed using a preset encoding format to obtain a compressed package in the preset encoding format.
- the compressed packet of the preset coding format is decoded by a decoder to obtain multiple frames of decoded images, and the lighting effects of the lighting device are controlled according to the multiple frames of decoded images.
- the preset coding formats include but are not limited to: MPEG-1, MPEG-2, MPEG-4, H.263 and H.264, and the decoders include but are not limited to: decoders in video codecs such as H.265, VP9 and AV1.
- the process of controlling the lighting effects of the lighting device according to each frame of the decoded image is similar to the process of controlling the lighting effects of the lighting device according to a static image, so this application will not repeat the description.
- user information is obtained. Since the user information can reflect the user's demand for lighting effects, static images or dynamic images that meet the user's needs can be flexibly generated according to the user information, so that the lighting device can be accurately controlled. In addition, since the lighting device can be accurately controlled, the dynamic image can provide richer lighting effects, thereby improving the user experience.
- FIG. 5 is a flow chart of a diffusion model training method provided in one embodiment of the present application.
- the training data includes multiple training images and description information for each training image, each training image having a corresponding style.
- the styles of the training images include, but are not limited to, realistic style and pixel style.
- the image content in the training images may be emojis.
- Each training image of the pixel style can be obtained by pixelating the original training image.
- the specific pixelation process can be referred to steps S231-S232 below.
- the original training image can be obtained from a preset dataset, wherein the preset dataset can be set by itself and is not limited in this application.
- the electronic device may call a natural language processing model to identify each training image and obtain description information of each training image.
- the natural language processing model may be set by itself, and this application does not limit this.
- the natural language processing model may be a GPT4-V model, a BLIP model, a BLIP2 model, or a DeepBooru model.
- the description information of the training image is a description of the object in the training image, and the description information includes but is not limited to: words, phrases, and sentences.
- the description information of the training image may include expressions, actions, and objects.
- model fine-tuning algorithms include, but are not limited to, Low-Rank Adaption (LoRA) and DreamBooth.
- the electronic device uses training data to adjust the diffusion network based on the model fine-tuning algorithm to obtain the diffusion model.
- the process is essentially the same as the process of generating static and dynamic images using the diffusion model described above, and is not repeated in this application.
- the diffusion model can output a static or dynamic image corresponding to the theme and style.
- the diffusion model can output a static or dynamic image corresponding to the theme and a preset style.
- the preset style can be set voluntarily, and this application does not impose any restrictions on this.
- the preset style can be a realistic style or a pixel style. Style refers to the visual style of an image.
- FIG6 is a flow chart of a method for controlling lighting effects provided by another embodiment of the present application, the method includes the following steps:
- the user information and the process of obtaining the user information may refer to step S11, and the present application will not repeat the description here.
- S22 Generate a static image or a dynamic image according to the user information.
- the generation process of static images and dynamic images can refer to step S12, and the present application will not repeat the description here.
- the electronic device can perform pixelation processing on static images or dynamic images based on a trained image translation neural network model (Cycle-Consistent Generative Adversarial Network, CycleGAN).
- a trained image translation neural network model (Cycle-Consistent Generative Adversarial Network, CycleGAN).
- the trained image translation neural network model learns the pixelated mapping relationship. If the resolution of the static image or dynamic image is different from the resolution required by the input image of the image translation neural network model, the static image or dynamic image can be scaled first so that the resolution of the static image or dynamic image after scaling is the same as the resolution required by the input image of the image translation neural network model. For example, if the resolution of the static image or dynamic image is 512x512 and the resolution required by the input image of the image translation neural network model is 256x256, the electronic device can downsample the static image or dynamic image so that the resolution of the downsampled static image or dynamic image is 256x256.
- the resolution of the pixelated still image or dynamic image output by the image translation neural network model is smaller than the resolution of the still image or dynamic image input to the image translation neural network model. For example, if the resolution of the still image or dynamic image input to the image translation neural network model is 512x512, the resolution of the pixelated still image or dynamic image output by the image translation neural network model is 256x256.
- the pixelated static image or dynamic image in order to match the number of light-emitting elements in the lighting device, can be downsampled, and the lighting effect of the lighting device can be controlled based on the downsampled static image or dynamic image. For example, if the lighting device is a curtain light with 520 lamp beads, and the resolution of the pixelated static image or dynamic image is 256x256, the electronic device can downsample the pixelated static image or dynamic image through the nearest neighbor downsampling algorithm, so that the resolution of the downsampled static image or dynamic image is 26x20.
- the electronic device can downsample the pixelated static image or dynamic image through the nearest neighbor downsampling algorithm, so that the resolution of the downsampled static image or dynamic image is 32x32.
- the static image or dynamic image is pixelated by an image translation neural network model.
- the image translation neural network model learns the mapping relationship between pixelation and can output a pixelated static image or dynamic image with a smaller resolution than the original static image or dynamic image, it can reduce detail loss, blurring, and color distortion, thereby ensuring the accuracy of the lighting effect and the adaptability between the lighting effect and user information.
- the above-mentioned image translation neural network model is only Examples, other network models can also be used in actual applications.
- the image translation neural network before using the image translation neural network model for pixelation processing, the image translation neural network needs to be trained in advance so that the trained image translation neural network model can learn the pixelation mapping relationship and thus output the pixelated image.
- Figure 7 it is a flow chart of the training method of the image translation neural network model provided in one embodiment of the present application, which specifically includes the following steps:
- constructing a pixelated data set by an electronic device includes: the electronic device acquiring multiple original images, wherein the image resolution of each original image is the same as the resolution required for the input image of the image translation neural network, and downsampling each original image through a filter to obtain an image of a preset resolution, the electronic device upsampling the image of the preset resolution through an interpolation algorithm so that the resolution of the upsampled image is the same as the resolution required for the input image of the image translation neural network, determining the upsampled image as the pixelated image corresponding to each original image, and determining the multiple original images and the pixelated image corresponding to each original image as image data in the pixelated data set.
- the filter and interpolation algorithm can be set by yourself, and this application does not impose any restrictions on this.
- the filter can be a Lanczos filter, and the interpolation algorithm can be a nearest neighbor interpolation algorithm.
- the preset resolution can be set by yourself, and this application does not impose any restrictions on this.
- the preset resolution can be 80x80, 64x64, 48x48, 32x32, 16x16, etc.
- the downsampling of each original image by the filter can be random.
- the style of each pixelated image is a pixel style. For an introduction to the pixel style, please refer to step S11, and this application will not repeat the description.
- the image resolution of the original image and the resolution required for the input image of the image translation neural network are both 256x256.
- the electronic device can downsample each original image to a resolution of 64x64 through a Lanczos filter to obtain a 64x64 image, and upsample the 64x64 image to 256x256 through a nearest neighbor interpolation algorithm to obtain a pixelated image corresponding to each original image.
- the multiple original images and the pixelated image corresponding to each original image are determined as image data in the pixelated dataset.
- the electronic device can scale the original image so that the resolution of the scaled original image is the same as the resolution required by the input image of the image translation neural network.
- the original image can be scaled by a variety of methods, and the present application does not limit the scaling method. For example, continuing with the above embodiment, if the image resolution of the original image is 128x128 and the resolution required by the input image of the image translation neural network is 256x256, the electronic device can scale the resolution of each original image from 128x128 to 256x256 through bilinear interpolation.
- the image translation neural network learns how to convert or map the style of the original image into a pixel style or a realistic style, so that the trained image translation neural network model can directly convert the style of any image into a pixel style or a realistic style.
- the diffusion model can output a static image or a dynamic image corresponding to the subject and preset style.
- the preset style can be set by yourself, and this application does not impose any restrictions on this.
- the preset style can be a realistic style or a pixel style.
- Style refers to the visual style of an image.
- the electronic device can train the image translation neural network based on each original image and the pixelated image of each original image in the pixelated dataset through an adversarial training method.
- the image translation neural network consists of two generative adversarial networks (GANs), each consisting of a generator and a discriminator.
- GANs generative adversarial networks
- the generator and discriminator of one GAN are referred to as the first generator and the first discriminator, respectively
- the generator and discriminator of the other GAN are referred to as the second generator and the second discriminator, respectively.
- the electronic device calls the first generator to generate a first generated image of a corresponding pixel style based on each original image, and calculates a first loss value of the first generator based on the difference between the pixelated image corresponding to each original image and the first generated image, and adjusts the first generator based on the first loss value.
- the electronic device calls the first discriminator to identify each first generated image, outputs a first identification result, calculates a second loss value of the first discriminator based on the difference between the first identification result and the first preset label, and adjusts the first discriminator based on the second loss value.
- the first identification result can be a label indicating whether the input first generated image is true or false.
- the first identification result can be 0 or 1
- the first preset label can be 0.
- the preset conditions can be set voluntarily and are not limited in this application. Since the first preset label indicates a label identified as false, when calculating the second loss value of the first discriminator based on the first preset label, the difference between the first identification result and the first preset label can be used as a basis for measuring the accuracy of the first discriminator's judgment. By minimizing this difference to adjust the parameters of the first discriminator, the ability of the first discriminator to judge the authenticity of the first generated image can be improved.
- the first generator and the first discriminator have opposite training objectives and opposite losses.
- the training objective of the first generator is to generate a first generated image that is similar to the pixelated version of each original image, such that the first discriminator cannot distinguish it.
- the training objective of the first discriminator is to accurately distinguish the first generated image generated by the first generator from the corresponding pixelated image.
- the electronic device invokes the second generator to generate a second generated image corresponding to each original image based on the pixelated image corresponding to the original image.
- the electronic device calculates a third loss value for the second generator based on the difference between each original image and the corresponding second generated image, and adjusts the second generator based on the third loss value.
- the electronic device invokes the second discriminator to perform authentication on each second generated image, outputs a second authentication result, calculates a fourth loss value for the second discriminator based on the difference between the second authentication result and the second preset label, and adjusts the second discriminator based on the fourth loss value.
- the second authentication result may be a label indicating whether the input second generated image is true or false.
- the second authentication result may be 0 or 1
- the second preset label may be 0.
- the preset conditions can be set voluntarily and are not limited in this application. Since the second preset label indicates a label for authentication as false, when calculating the fourth loss value for the second discriminator based on the second preset label, the difference between the second authentication result and the second preset label may be used as a basis for measuring the accuracy of the second discriminator's judgment. By minimizing this difference and adjusting the parameters of the second discriminator, the ability of the second discriminator to judge the authenticity of the second generated image can be improved.
- the second generator and the second discriminator have opposite training objectives and opposite losses.
- the training objective of the second generator is to generate a second generated image similar to the original image based on the pixelated image corresponding to each original image, so that the second discriminator cannot distinguish the second generated image.
- the training objective of the second discriminator is to accurately distinguish the second generated image generated by the second generator from the corresponding original image.
- the electronic device calls the first generator to train the second generator.
- the electronic device converts each second generated image generated by the generator to obtain a third generated image corresponding to each pixelated image, calculates a fifth loss value based on each pixelated image and the corresponding third generated image, and adjusts the first generator based on the fifth loss value.
- the electronic device calls the second generator to convert each first generated image generated by the first generator to obtain a fourth generated image corresponding to each original image.
- the electronic device calculates a sixth loss value based on each original image and the corresponding fourth generated image, and adjusts the second generator based on the sixth loss value.
- the trained image translation neural network model may include the first generator model and the second generator model.
- the preset conditions can be set arbitrarily, and this application does not impose any restrictions on this.
- the preset condition may be that the loss value no longer changes, or that the amplitude of change between multiple consecutive loss values is within a preset range.
- the preset range can be set arbitrarily, and this application does not impose any restrictions on symmetry.
- the first generator is in opposite directions to the second generator, and the first discriminator is in opposite directions to the second discriminator.
- Such a structure can realize pixelation (Pixelization) and depixelation (Depixelization).
- the trained first generator model can learn the pixelation mapping relationship.
- the electronic device can call the first generator model to perform pixelation processing on the static image or the dynamic image to obtain a static image or a dynamic image after pixelation processing.
- the trained second generator model can learn the depixelation mapping relationship.
- the electronic device can call the second generator model to perform depixelation processing on the pixelated image to obtain an image after depixelation processing.
- FIG 8 shows a functional block diagram of a lighting effect control device according to one embodiment of the present application.
- the lighting effect control device 11 includes an acquisition unit 110, a generation unit 111, and a control unit 112.
- a module/unit as referred to herein refers to a series of computer-readable instruction segments that can be acquired by the processor 103 in Figure 9 and perform a fixed function, and is stored in the memory 102 in Figure 9. The functions of each module/unit in this embodiment will be described in detail in subsequent embodiments.
- the acquiring unit 110 is configured to acquire user information.
- the user information includes at least one of text, video, image, and sound.
- the generating unit 111 is configured to generate a static image or a dynamic image according to user information.
- the generation unit 111 is further used to generate a static image or dynamic image of the theme corresponding to the theme information according to a preset style. If the user information includes theme information and style information, the generation unit 111 is further used to generate a static image or dynamic image of the theme corresponding to the theme information according to the style corresponding to the style information.
- the generation unit 111 is further configured to process user information based on artificial intelligence content generation technology to generate static images or dynamic images.
- the generating unit 111 is further configured to input user information into a diffusion model to generate a static image or a dynamic image.
- the control unit 112 is configured to control the lighting effects of the lighting device according to static images or dynamic images.
- control unit 112 is further configured to perform pixelation processing on a static image or a dynamic image, and control a lighting effect of a lighting device according to the pixelated static image or dynamic image.
- control unit 112 is further configured to perform pixelation processing on a static image or a dynamic image based on an image translation neural network model.
- control unit 112 is further used to control the lighting effect of each lighting device or each light-emitting element in the lighting device according to the pixel value of each pixel point in the static image, or to control the lighting effect of each lighting device or each light-emitting element in the lighting device according to the pixel values of multiple pixel points in the static image.
- the dynamic image includes multiple frames of static images
- the control unit 112 is further used to control the lighting effect of each lighting device or each light-emitting element in the lighting device according to the pixel value of each pixel point of each static image frame in the dynamic image, or to control the lighting effect of each lighting device or each light-emitting element in the lighting device according to the pixel values of multiple pixel points of each static image frame in the dynamic image.
- Figure 9 is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application.
- the electronic device 10 may include a communication module 101, a memory 102, a processor 103, an input/output (I/O) interface 104, and a bus 105.
- the processor 103 is coupled to the communication module 101, the memory 102, and the input/output interface 104 via the bus 105.
- the communication module 101 may include a wired communication module and/or a wireless communication module.
- the wired communication module may provide one or more wired communication solutions such as universal serial bus (USB) and controller area network (CAN).
- the wireless communication module may provide one or more wireless communication solutions such as wireless fidelity (Wi-Fi), Bluetooth (BT), mobile communication network, frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc.
- the memory 102 may include one or more random access memories (RAMs) and one or more non-volatile memories (NVMs).
- the RAM can be directly read and written by the processor 103 and can be used to store executable programs (e.g., machine instructions) of other running programs, as well as user and application data.
- the RAM may include static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), etc.
- Non-volatile memory can also store executable programs and user and application data, etc., and can be pre-loaded into random access memory for direct reading and writing by processor 103.
- Non-volatile memory can include disk storage devices and flash memory.
- the memory 102 is used to store one or more computer programs.
- the one or more computer programs are configured to be executed by the processor 103.
- the one or more computer programs include multiple instructions. When the multiple instructions are executed by the processor 103, the lighting effect control method executed on the electronic device 10 can be implemented.
- the electronic device 10 shown in FIG. 9 further includes an external memory interface for connecting to an external memory to expand the storage capacity of the electronic device 10 .
- the processor 103 may include one or more processing units.
- the processor 103 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), and/or a neural-network processing unit (NPU).
- the different processing units may be independent devices or integrated into one or more processors.
- the processor 103 provides computing and control capabilities.
- the processor 103 is used to execute the programs stored in the memory 102.
- Computer program to implement the above-mentioned lighting effect control method.
- the input/output interface 104 is used to provide a channel for user input or output.
- the input/output interface 104 can be used to connect various input and output devices, such as a mouse, keyboard, touch device, display screen, etc., so that the user can enter information or visualize information.
- the bus 105 is at least used to provide a channel for mutual communication among the communication module 101 , the memory 102 , the processor 103 , and the input/output interface 104 in the electronic device 10 .
- the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 10.
- the electronic device 10 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently.
- the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
- An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored.
- the computer program includes program instructions.
- the method implemented when the program instructions are executed can refer to the methods in the above-mentioned embodiments of the present application.
- the computer-readable storage medium may be the internal memory of the electronic device described in the above embodiments, such as the hard disk or memory of the electronic device.
- the computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash memory card, etc.
- SMC smart media card
- SD secure digital
- the computer-readable storage medium may include a program storage area and a data storage area, wherein the program storage area may store an operating system, applications required for at least one function, etc.; the data storage area may store data created according to the use of the electronic device, etc.
- the disclosed devices/electronic devices and methods can be implemented in other ways.
- the device/electronic device embodiments described above are merely schematic.
- the division of the modules or units is merely a logical function division.
- Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
- Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Graphics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Image Processing (AREA)
- Processing Or Creating Images (AREA)
Abstract
Description
本申请属于照明技术领域,尤其涉及一种灯光效果控制方法、装置、电子设备及存储介质。The present application relates to the field of lighting technology, and in particular to a lighting effect control method, device, electronic device, and storage medium.
随着照明技术的不断发展,智能化照明已经成为一种趋势。相关技术中,往往依据固定的图像模板控制灯光效果,这将会导致用户需求与灯光效果之间出现不匹配的情况,难以对照明设备进行准确控制,从而无法为用户提供个性化的用户体验。With the continuous development of lighting technology, intelligent lighting has become a trend. Related technologies often control lighting effects based on fixed image templates. This can lead to a mismatch between user needs and lighting effects, making it difficult to accurately control lighting equipment and thus failing to provide users with a personalized user experience.
发明内容Summary of the Invention
鉴于以上内容,有必要提供一种灯光效果控制方法、装置、电子设备及存储介质,能够解决由于用户需求与灯光效果之间出现不匹配而造成难以对照明设备进行有效控制以及用户体验感不佳的技术问题。In view of the above, it is necessary to provide a lighting effect control method, device, electronic device and storage medium that can solve the technical problems of difficulty in effectively controlling lighting equipment and poor user experience due to the mismatch between user needs and lighting effects.
一方面,本申请提供一种灯光效果控制方法,所述方法包括:获取用户信息,根据所述用户信息生成静态图像或动态图像,根据所述静态图像或所述动态图像,控制照明设备的灯光效果。On the one hand, the present application provides a lighting effect control method, which includes: obtaining user information, generating a static image or a dynamic image based on the user information, and controlling the lighting effect of a lighting device based on the static image or the dynamic image.
在本申请的一些实施例中,所述用户信息包括文本、视频、图像及声音中的至少一种。In some embodiments of the present application, the user information includes at least one of text, video, image and sound.
在本申请的一些实施例中,所述根据所述用户信息生成静态图像或动态图像包括:若所述用户信息包括主题信息,根据预设风格生成所述主题信息的对应主题的静态图像或动态图像,若所述用户信息包括主题信息和风格信息,根据所述风格信息对应的风格,生成所述主题信息对应主题的静态图像或动态图像。In some embodiments of the present application, generating a static image or a dynamic image based on the user information includes: if the user information includes theme information, generating a static image or a dynamic image of the theme corresponding to the theme information according to a preset style; if the user information includes theme information and style information, generating a static image or a dynamic image of the theme corresponding to the theme information according to the style corresponding to the style information.
在本申请的一些实施例中,所述根据所述用户信息生成静态图像或动态图像包括:基于人工智能生成内容技术对所述用户信息进行处理,生成所述静态图像或所述动态图像。In some embodiments of the present application, generating a static image or a dynamic image based on the user information includes: processing the user information based on artificial intelligence content generation technology to generate the static image or the dynamic image.
在本申请的一些实施例中,所述基于人工智能生成内容技术对所述用户信息进行处理,生成所述静态图像或所述动态图像包括:将所述用户信息输入至扩散模型中,生成所述静态图像或所述动态图像。In some embodiments of the present application, the processing of the user information based on artificial intelligence content generation technology to generate the static image or the dynamic image includes: inputting the user information into a diffusion model to generate the static image or the dynamic image.
在本申请的一些实施例中,所述方法还包括:对所述静态图像或所述动态图像进行像素化处理,并根据像素化处理后的静态图像或动态图像,控制所述照明设备的灯光效果。In some embodiments of the present application, the method further includes: performing pixelation processing on the static image or the dynamic image, and controlling the lighting effect of the lighting device according to the pixelated static image or dynamic image.
在本申请的一些实施例中,所述对所述静态图像或所述动态图像进行像素化处理包 括:基于图像翻译神经网络模型对所述静态图像或所述动态图像进行像素化处理。In some embodiments of the present application, the pixelation processing of the static image or the dynamic image includes: In summary: pixelating the static image or the dynamic image based on an image translation neural network model.
在本申请的一些实施例中,所述根据所述静态图像,控制照明设备的灯光效果包括:根据所述静态图像中每个像素点的像素值,控制每个所述照明设备或所述照明设备中每个发光元件的灯光效果,或,根据所述静态图像中多个像素点的像素值,控制每个所述照明设备或所述照明设备中每个发光元件的灯光效果。In some embodiments of the present application, controlling the lighting effects of the lighting device based on the static image includes: controlling the lighting effects of each of the lighting devices or each light-emitting element in the lighting device based on the pixel value of each pixel in the static image, or controlling the lighting effects of each of the lighting devices or each light-emitting element in the lighting device based on the pixel values of multiple pixels in the static image.
另一方面,本申请提供一种灯光效果控制装置,运行于电子设备,所述灯光效果控制装置包括:获取单元,用于获取用户信息,生成单元,用于根据所述用户信息生成静态图像或动态图像,控制单元,用于根据所述静态图像或所述动态图像,控制照明设备的灯光效果。On the other hand, the present application provides a lighting effect control device that runs on an electronic device, and the lighting effect control device includes: an acquisition unit for acquiring user information, a generation unit for generating a static image or a dynamic image based on the user information, and a control unit for controlling the lighting effect of the lighting device based on the static image or the dynamic image.
另一方面,本申请提供一种电子设备,电子设备包括:存储器,存储至少一个指令;及处理器,执行至少一个指令以实现所述的灯光效果控制方法。On the other hand, the present application provides an electronic device, which includes: a memory storing at least one instruction; and a processor executing at least one instruction to implement the lighting effect control method.
另一方面,本申请提供一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一个指令,所述至少一个指令被电子设备中的处理器执行以实现所述的灯光效果控制方法。On the other hand, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores at least one instruction, and the at least one instruction is executed by a processor in an electronic device to implement the lighting effect control method.
通过上述实施方式,获取用户信息,由于用户信息能够反映用户对灯光效果的需求,因此根据用户信息,能够灵活地生成符合用户需求的静态图像或动态图像,从而能够对照明设备进行准确控制。此外,由于能够对照明设备进行准确控制,动态图像能够提供更丰富的灯光效果,因此能够提高用户体验感。Through the above-described implementation, user information is obtained. Since user information can reflect the user's lighting effect requirements, static or dynamic images that meet the user's needs can be flexibly generated based on the user information, thereby accurately controlling the lighting device. Furthermore, due to the accurate control of the lighting device, dynamic images can provide richer lighting effects, thereby improving the user experience.
图1是本申请一实施例提供的照明设备控制方法的应用场景图。FIG1 is a diagram showing an application scenario of a lighting device control method provided in an embodiment of the present application.
图2是本申请一实施例提供的灯光效果控制方法的流程图。FIG2 is a flow chart of a lighting effect control method provided in an embodiment of the present application.
图3是本申请一实施例提供的写实风格的静态图像的示意图。FIG3 is a schematic diagram of a realistic-style static image provided by an embodiment of the present application.
图4是本申请一实施例提供的像素风格的静态图像的示意图。FIG4 is a schematic diagram of a pixel-style static image provided by an embodiment of the present application.
图5是本申请一实施例提供的扩散模型的训练方法的流程图。FIG5 is a flowchart of a method for training a diffusion model according to an embodiment of the present application.
图6是本申请另一实施例提供的灯光效果的控制方法的流程图。FIG6 is a flowchart of a method for controlling lighting effects provided in another embodiment of the present application.
图7是本申请一实施例提供的图像翻译神经网络模型的训练方法的流程图。FIG7 is a flowchart of a method for training an image translation neural network model according to an embodiment of the present application.
图8是本申请一实施例提供的灯光效果控制装置的功能模块图。FIG8 is a functional module diagram of a lighting effect control device provided in an embodiment of the present application.
图9是本申请一实施例提供的电子设备的结构示意图。FIG9 is a schematic structural diagram of an electronic device provided in one embodiment of the present application.
为了使本申请的目的、技术方案和优点更加清楚,下面结合附图和具体实施例对本申请进行详细描述。In order to make the objectives, technical solutions and advantages of this application clearer, this application is described in detail below with reference to the accompanying drawings and specific embodiments.
需要说明的是,本申请中“至少一个”是指一个或者多个,“多个”是指两个或多于两个。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。本申请的说明书和权利要求书及附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不是用于描述特定的顺序或先后次序。 It should be noted that in this application, "at least one" means one or more, and "more than one" means two or more than two. "And/or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and/or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and drawings of this application are used to distinguish similar objects, rather than to describe a specific order or sequence.
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
随着照明技术的不断发展,智能化照明已经成为一种趋势。相关技术中,往往依据固定的图像模板控制灯光效果,这将会导致用户需求与灯光效果之间出现不匹配的情况,难以对照明设备进行准确控制,从而无法为用户提供个性化的用户体验。With the continuous development of lighting technology, intelligent lighting has become a trend. Related technologies often control lighting effects based on fixed image templates. This can lead to a mismatch between user needs and lighting effects, making it difficult to accurately control lighting equipment and thus failing to provide users with a personalized user experience.
为了解决上述技术问题,本申请提供一种灯光效果控制方法、装置、电子设备及存储介质,能够对照明设备进行准确控制以及提供更丰富的灯光效果,从而能够提高用户体验感。本申请实施例提供的照明控制方法的执行主体可以为一个或者多个电子设备。To address the above technical issues, the present application provides a lighting effect control method, apparatus, electronic device, and storage medium that can accurately control lighting equipment and provide richer lighting effects, thereby improving user experience. The lighting control method provided in the embodiments of the present application can be executed by one or more electronic devices.
如图1所示,是本申请一实施例提供的照明设备控制方法的应用场景图。在图1中,电子设备10分别与多个照明设备20进行通信,图1中仅标示了一个照明设备。As shown in Figure 1, it is an application scenario diagram of the lighting device control method provided by an embodiment of the present application. In Figure 1, an electronic device 10 communicates with multiple lighting devices 20 respectively, and Figure 1 only shows one lighting device.
例如,图1中的照明设备20为灯串,灯串构成一面窗帘灯,窗帘灯上展现了像素风格的南瓜元素,窗帘灯上灯珠的灯光效果(灯光效果)还可以与声音(比如音乐)同步,使得灯光效果与场景更加匹配。除了图1所示的灯串之外,照明设备20可以为能够提供照明功能的各类灯具。例如,照明设备20还可以为LED灯、节能灯、投光灯、安防灯、灯带以及屋檐灯等。灯串由多个灯珠组成,每个灯珠内集成了集成电路。通过一根信号线,控制器将灯串的所有灯珠的集成电路串联起来,从而实现对整个灯串的控制。For example, the lighting device 20 in Figure 1 is a light string, which constitutes a curtain light. The curtain light shows a pixel-style pumpkin element, and the lighting effect (lighting effect) of the lamp beads on the curtain light can also be synchronized with the sound (such as music), so that the lighting effect is more in line with the scene. In addition to the light string shown in Figure 1, the lighting device 20 can be various types of lamps that can provide lighting functions. For example, the lighting device 20 can also be an LED lamp, an energy-saving lamp, a floodlight, a security lamp, a light strip, and an eaves lamp. The light string is composed of a plurality of lamp beads, each of which has an integrated circuit integrated in it. Through a signal line, the controller connects the integrated circuits of all the lamp beads in the light string in series, thereby realizing control of the entire light string.
图1中的电子设备10为手机。除了图1所示的手机之外,电子设备10还可以为平板电脑、笔记本电脑及计算机等电子设备,本申请实施例对电子设备10的具体类型不作任何限制。电子设备10可通过蓝牙、热点、Wi-Fi等方式与多个照明设备20相连接,从而使得电子设备10可以控制多个照明设备20。The electronic device 10 in Figure 1 is a mobile phone. Besides the mobile phone shown in Figure 1 , the electronic device 10 may also be a tablet computer, a laptop computer, or a computer. The present embodiment does not impose any restrictions on the specific type of the electronic device 10. The electronic device 10 can connect to multiple lighting devices 20 via Bluetooth, hotspots, Wi-Fi, or other methods, thereby enabling the electronic device 10 to control the multiple lighting devices 20.
如图2所示,是本申请一实施例提供的灯光效果控制方法的流程图。根据不同的需求,该流程图中各个步骤的顺序可以根据实际要求进行调整,某些步骤可以省略。所述方法的执行主体为电子设备,例如图1所示的电子设备10。FIG2 is a flowchart of a lighting effect control method according to an embodiment of the present application. The order of the steps in the flowchart may be adjusted based on different needs, and some steps may be omitted. The method is performed by an electronic device, such as the electronic device 10 shown in FIG1 .
S11,获取用户信息。S11, obtain user information.
在本申请的一些实施例中,用户信息包括文本、视频、图像及声音中的至少一种,其中,声音可以包括即时语音和音频文件等多种文件形式,声音可以为声音特效、语音及音乐等。用户信息中的图像包括静态的图像和动态的图像(比如GIF格式的图像)等多种图像格式。用户信息可以包括用户输入的文字、视频、图像及声音等,用户信息可以通过用户在键盘敲字输入、用户在电子设备的交互界面手写输入、电子设备将麦克风收录的语音进行转换或者电子设备对图像进行解析等多种方式获取得到,本申请对此不作限制。In some embodiments of the present application, user information includes at least one of text, video, image and sound, wherein the sound may include various file formats such as instant voice and audio files, and the sound may be sound effects, voice and music, etc. The images in the user information include various image formats such as static images and dynamic images (such as images in GIF format). User information may include text, video, image and sound input by the user, and the user information may be obtained in various ways such as the user typing on the keyboard, the user handwriting input on the interactive interface of the electronic device, the electronic device converting the voice recorded by the microphone, or the electronic device parsing the image, and the present application does not impose any restrictions on this.
在本申请的一些实施例中,用户信息包括主题信息,或者,用户信息包括主题信息和风格信息,主题信息用于控制下文中静态图像或动态图像的主题,风格信息用于控制静态图像或动态图像的风格。其中,主题可以为静态图像或动态图像中的图像内容,风格可以为静态图像或动态图像的视觉风格。主题包括但不限于:节日、日常生活、兴趣爱好、自然风景以及娱乐等。例如,节日可以包括春节、中秋节、圣诞节、感恩节及万圣节等,日常生活可以包括家庭生活、工作场景及学校生活等,兴趣爱好可以为阅读、 音乐、绘画、摄影、健身及旅游等、娱乐可以包括游戏、运动、影视、动画及明星等。In some embodiments of the present application, user information includes theme information, or user information includes theme information and style information, the theme information is used to control the theme of the static image or dynamic image below, and the style information is used to control the style of the static image or dynamic image. Among them, the theme can be the image content in the static image or dynamic image, and the style can be the visual style of the static image or dynamic image. Themes include but are not limited to: festivals, daily life, hobbies, natural scenery, and entertainment. For example, festivals can include the Spring Festival, Mid-Autumn Festival, Christmas, Thanksgiving, and Halloween, etc., daily life can include family life, work scenes, and school life, etc., and hobbies can be reading, Music, painting, photography, fitness and travel, etc. Entertainment can include games, sports, film and television, animation and celebrities, etc.
风格包括但不限于:写实风格和像素风格等。其中,写实风格是一种追求真实感的表现形式,通过精细的描绘和逼真的表现手法,力求再现现实生活中的场景和人物。写实风格的图像具有纹理清晰、画面真实、色彩丰富自然、笔触细腻以及光影真实的特点,呈现出逼真的视觉效果。像素风格是一种通过像素点对人物或场景进行表现的表现形式,通过将图像分解为像素点,呈现出一种像素化的效果。像素风格的图像具有色彩鲜明、细节简化、复古感以及动态感的特点,通过简练的线条和形状来表现对象的特点,使用高对比度的颜色来表现画面的主题,通常采用低分辨率的图像元素,简单的图像元素和明快的色彩。Styles include, but are not limited to, realistic style and pixel style. Realistic style is a form of expression that pursues realism, and strives to reproduce real-life scenes and characters through detailed depiction and realistic expression techniques. Realistic-style images are characterized by clear textures, realistic pictures, rich and natural colors, delicate brushstrokes, and realistic light and shadow, presenting a realistic visual effect. Pixel style is a form of expression that uses pixels to express characters or scenes, and presents a pixelated effect by decomposing the image into pixels. Pixel-style images are characterized by bright colors, simplified details, a retro feel, and a sense of dynamism. They express the characteristics of the object through concise lines and shapes, and use high-contrast colors to express the theme of the picture. They usually use low-resolution image elements, simple image elements, and bright colors.
在本申请的一些实施例中,电子设备可以将用户信息中的声音信息转化为文本信息,将用户信息中的动态图像和/或视频解耦为多帧图像,并通过转化后的文本和/或多帧图像,生成用户信息对应的静态图像或动态图像。In some embodiments of the present application, the electronic device can convert the sound information in the user information into text information, decouple the dynamic images and/or videos in the user information into multi-frame images, and generate a static image or dynamic image corresponding to the user information through the converted text and/or multi-frame images.
在本申请的一些实施例中,一类的用户信息可以仅包括主题信息,也可以同时包括主题信息和风格信息。例如,在用户信息为文本信息时,文本信息可以仅包括主题信息,也可以同时包括主题信息和风格信息。多类的用户信息可以仅包括主题信息,也可以同时包括主题信息和风格信息。例如,在用户信息包括文本信息和图像信息时,文本信息和图像信息可以仅包括主题信息,或者,文本信息和图像信息包括主题信息和风格信息,对于文本信息和图像信息包括主题信息和风格信息的情况可以为文本信息包括风格信息以及图像信息包括主题信息,或者,文本信息包括主题信息以及图像信息包括风格信息,或者,文本信息和图像信息均包括主题信息和风格信息。In some embodiments of the present application, one category of user information may include only subject information, or may include both subject information and style information. For example, when the user information is text information, the text information may include only subject information, or may include both subject information and style information. Multiple categories of user information may include only subject information, or may include both subject information and style information. For example, when the user information includes text information and image information, the text information and the image information may include only subject information, or the text information and the image information may include both subject information and style information. For the case where the text information and the image information include both subject information and style information, the text information may include style information and the image information may include subject information, or the text information may include subject information and the image information may include style information, or both the text information and the image information may include subject information and style information.
S12,根据用户信息生成静态图像或动态图像。S12, generating a static image or a dynamic image according to the user information.
在本申请的一些实施例中,动态图像是指包括动态变化效果的图像,动态图像可以展示一个过程或者多个连续的静态图像。当用户信息包括视频或者用户信息包括连续的多帧图像或者用户信息包括描述动态过程的文字信息时,可以根据用户信息直接得到视频或动态图像,或者,先根据用户信息生成视频,再从生成的视频选取多帧图像合成动态图像,其中,选取的图像的数量可以自行设置,本申请对此不作限制。In some embodiments of the present application, a dynamic image refers to an image that includes a dynamically changing effect. A dynamic image can display a process or multiple consecutive static images. When the user information includes a video, or the user information includes multiple consecutive frames of images, or the user information includes text information describing a dynamic process, the video or dynamic image can be directly obtained based on the user information. Alternatively, a video can be first generated based on the user information, and then multiple frames of images can be selected from the generated video to synthesize the dynamic image. The number of selected images can be set arbitrarily and is not limited by this application.
在本申请的一些实施例中,电子设备根据用户信息生成静态图像或动态图像包括:在用户信息包括主题信息时,电子设备基于用户信息,生成对应主题及预设风格的静态图像或动态图像,或者,在用户信息包括主题信息和风格信息时,电子设备根据用户信息生成静态图像或动态图像包括:电子设备基于用户信息,生成对应主题及对应风格的静态图像或动态图像。其中,预设风格可以自行设置,本申请对此不作限制。例如,预设风格可以为写实风格或者像素风格。In some embodiments of the present application, the electronic device generating a static image or dynamic image based on user information includes: when the user information includes theme information, the electronic device generating a static image or dynamic image corresponding to the theme and a preset style based on the user information; or, when the user information includes theme information and style information, the electronic device generating a static image or dynamic image based on the user information includes: the electronic device generating a static image or dynamic image corresponding to the theme and a corresponding style based on the user information. The preset style can be set by the user, and this application does not limit this. For example, the preset style can be a realistic style or a pixel style.
具体地,电子设备基于人工智能生成内容技术(AI-Generated Content,AIGC)对用户信息进行处理,生成具有主题和/或风格的静态图像或动态图像。其中,人工智能生成内容技术可以为自行设置,本申请对此不作限制。例如,人工智能生成内容技术可以为训练后的扩散模型(Diffusion或Stable Diffusion)或ChatGPT等。Specifically, the electronic device processes user information based on artificial intelligence-generated content (AI-Generated Content, AIGC) technology to generate static or dynamic images with a theme and/or style. The AI-generated content technology can be customized and is not limited in this application. For example, the AI-generated content technology can be a trained diffusion model (Diffusion or Stable Diffusion) or ChatGPT.
在一些实施例中,扩散模型包括文本编码器模型(Text Encoder)、图像信息生成器模型(Image Generator)及自编码器(AutoEncoder)。例如,文本编码器模型可以为CLIP模型,图像生成器模型可以包括Unet网络和采样器算法,自编码器可以为 AutoEncoderKL。由于扩散模型包括文本编码器模型,因此扩散模型的输入信息包括文本信息。In some embodiments, the diffusion model includes a text encoder model (Text Encoder), an image information generator model (Image Generator) and an autoencoder (AutoEncoder). For example, the text encoder model can be a CLIP model, the image generator model can include a Unet network and a sampler algorithm, and the autoencoder can be AutoEncoderKL. Since the diffusion model includes a text encoder model, the input information of the diffusion model includes text information.
在另外一些实施例中,还可以通过注意力机制Attention和卷积神经网络Convolutional Neural Network实现扩散模型的网络架构。上述实现扩散模型架构的方法仅为示例,实际应用中还可以通过其他方式实现扩散模型的网络架构。In some other embodiments, the network architecture of the diffusion model can also be implemented using an attention mechanism and a convolutional neural network. The above method for implementing the diffusion model architecture is only an example. In actual applications, the network architecture of the diffusion model can also be implemented using other methods.
在本申请的一个实施例中,以用户信息包括文本信息为例,若用户信息包括主题信息和风格信息,电子设备将用户信息输入至训练后的扩散模型中,得到静态图像包括:电子设备调用文本编码器模型将用户信息编码为文本嵌入向量,电子设备调用潜在种子(Latent Seed)生成图像信息张量,将文本嵌入向量及图像信息张量输入至图像信息生成器模型,得到第一图像隐向量,利用第一图像隐向量对图像信息张量进行迭代,得到预设迭代次数对应的第一图像隐向量,电子设备调用自编码器中的图像解码器(Image Decoder)对预设迭代次数对应的第一图像隐向量进行解码,得到对应主题和对应风格的静态图像。其中,预设迭代次数可以自行设置,本申请对此不作限制。例如,预设迭代次数可以为50次。In one embodiment of the present application, taking the example of user information including text information, if the user information includes theme information and style information, the electronic device inputs the user information into the trained diffusion model to obtain a static image, including: the electronic device calls the text encoder model to encode the user information into a text embedding vector, the electronic device calls the latent seed (Latent Seed) to generate an image information tensor, the text embedding vector and the image information tensor are input into the image information generator model to obtain a first image latent vector, the image information tensor is iterated using the first image latent vector to obtain a first image latent vector corresponding to a preset number of iterations, the electronic device calls the image decoder (Image Decoder) in the autoencoder to decode the first image latent vector corresponding to the preset number of iterations to obtain a static image of the corresponding theme and style. The preset number of iterations can be set voluntarily, and this application does not impose any restrictions on this. For example, the preset number of iterations can be 50 times.
例如,在预设风格为写实风格时,若用户信息为文本信息:一张圣诞主题的照片,圣诞老人面带微笑站在一户人家门前脸上挂着圣诞礼物。其中,文本信息可以通过用户在键盘敲字输入、用户在电子设备的交互界面手写输入、电子设备将麦克风收录的语音进行转换或者电子设备对图像进行解析等多种方式获取得到。用户信息指示的静态图像的主题为圣诞节主题,未指示生成的静态图像的风格,电子设备可以调用扩散模型生成写实风格的静态图像,如图3所示,是本申请一实施例提供的写实风格的静态图像的示意图。如图3所示的写实风格的静态图像中包括戴着圣诞帽、穿着圣诞礼服、双手拿着圣诞礼物、脸上洋溢着微笑的圣诞老人。图3所示的写实风格的静态图像具有纹理清晰、画面真实、笔触细腻以及光影真实的特点。For example, when the preset style is realistic, if the user information is text information: a Christmas-themed photo, Santa Claus is standing in front of a house with a smile on his face and a Christmas gift hanging on his face. Among them, the text information can be obtained in a variety of ways, such as the user typing on the keyboard, the user handwriting input on the interactive interface of the electronic device, the electronic device converting the voice recorded by the microphone, or the electronic device parsing the image. The theme of the static image indicated by the user information is Christmas theme, and the style of the generated static image is not indicated. The electronic device can call the diffusion model to generate a realistic-style static image, as shown in Figure 3, which is a schematic diagram of a realistic-style static image provided by an embodiment of the present application. The realistic-style static image shown in Figure 3 includes Santa Claus wearing a Santa hat, a Christmas suit, holding Christmas gifts in both hands, and a smile on his face. The realistic-style static image shown in Figure 3 has the characteristics of clear texture, realistic picture, delicate brushstrokes, and realistic light and shadow.
在本申请的另外一个实施例中,以用户信息包括文本信息及图像信息为例,若用户信息包括主题信息和风格信息,电子设备将用户信息输入至训练后的扩散模型中,得到静态图像包括:电子设备调用文本编码器模型将用户信息中的文本信息编码为文本嵌入向量,电子设备调用自编码器中的图像编码器(Image Encoder)将用户信息中的图像信息编码为图像嵌入向量,将文本嵌入向量及图像嵌入向量输入至图像信息生成器模型,得到第二图像隐向量,利用第二图像隐向量对图像嵌入向量进行迭代,得到预设迭代次数对应的第二图像隐向量,电子设备调用自编码器中的图像解码器对预设迭代次数对应的第二图像隐向量进行解码,得到对应主题和对应风格的静态图像。In another embodiment of the present application, taking the example of user information including text information and image information, if the user information includes theme information and style information, the electronic device inputs the user information into the trained diffusion model to obtain a static image, including: the electronic device calls the text encoder model to encode the text information in the user information into a text embedding vector, the electronic device calls the image encoder (Image Encoder) in the autoencoder to encode the image information in the user information into an image embedding vector, inputs the text embedding vector and the image embedding vector into the image information generator model to obtain a second image latent vector, uses the second image latent vector to iterate the image embedding vector to obtain a second image latent vector corresponding to a preset number of iterations, and the electronic device calls the image decoder in the autoencoder to decode the second image latent vector corresponding to the preset number of iterations to obtain a static image of the corresponding theme and corresponding style.
例如,若用户信息为文本信息:一张圣诞主题的像素化照片,圣诞老人面带微笑站在一户人家门前脸上挂着圣诞礼物。其中,文本信息可以通过用户在键盘敲字输入、用户在电子设备的交互界面手写输入、电子设备将麦克风收录的语音进行转换或者电子设备对图像进行解析等多种方式获取得到。用户信息指示生成的静态图像的主题为圣诞节主题,指示生成的静态图像的风格为像素风格,电子设备可以调用扩散模型生成像素风格的静态图像。如图4所示,是本申请一实施例提供的像素风格的静态图像的示意图。如图4所示的像素风格的静态图像中包括戴着圣诞帽、穿着圣诞礼服、双手拿着圣诞礼物、脸上洋溢着微笑的圣诞老人。图4所示的像素风格的静态图像呈现出一种像素化的 效果,具有细节简化、复古感以及动态感的特点。For example, if the user information is text information: a pixelated photo with a Christmas theme, Santa Claus is standing in front of a house with a smile on his face and a Christmas gift hanging on his face. The text information can be obtained in a variety of ways, such as the user typing on the keyboard, the user handwriting in the interactive interface of the electronic device, the electronic device converting the voice recorded by the microphone, or the electronic device parsing the image. The user information indicates that the theme of the generated static image is a Christmas theme, and indicates that the style of the generated static image is a pixel style. The electronic device can call the diffusion model to generate a pixel-style static image. As shown in Figure 4, it is a schematic diagram of a pixel-style static image provided by an embodiment of the present application. The pixel-style static image shown in Figure 4 includes Santa Claus wearing a Santa hat, a Christmas suit, holding Christmas gifts in both hands, and a smile on his face. The pixel-style static image shown in Figure 4 presents a pixelated The effect is characterized by simplified details, retro feel and dynamic feeling.
在本申请的其他实施例中,以用户信息包括动态图像和/或视频为例,若用户信息包括主题信息和风格信息,由于用户信息中的动态图像和/或视频包括多帧图像,因此电子设备将用户信息中的动态图像和/或视频的多帧图像输入至扩散模型中,得到每帧图像对应的静态图像,将多帧图像对应的静态图像进行合成处理,得到对应主题和对应风格的动态图像。其中,每帧图像对应的静态图像的生成方式可以参考示例中静态图像的生成方式,本申请不再重复描述。In other embodiments of the present application, taking the example of user information including dynamic images and/or videos, if the user information includes theme information and style information, since the dynamic images and/or videos in the user information include multiple frames of images, the electronic device inputs the multiple frames of the dynamic images and/or videos in the user information into the diffusion model to obtain a static image corresponding to each frame of the image, and synthesizes the static images corresponding to the multiple frames of the image to obtain a dynamic image corresponding to the theme and the corresponding style. The method for generating the static image corresponding to each frame of the image can refer to the method for generating the static image in the example, and will not be repeated in this application.
在本申请的其他实施例,针对用户信息仅包括主题信息的情况,对应主题和预设风格的静态图像或动态图像的生成方式可以参考上述示例,本申请不再一一说明。In other embodiments of the present application, for the case where user information only includes theme information, the generation method of static images or dynamic images corresponding to the theme and preset style can refer to the above examples, and this application will not explain them one by one.
在本申请的其他实施例中,为了提高电子设备的运行效率,人工智能生成内容技术可以部署于服务器、云端或云服务器等设备中,电子设备可以通过蓝牙、热点、Wi-Fi等方式与服务器、云端或云服务器等设备通信,从而获取人工智能生成内容技术生成的静态图像或动态图像。例如,在接收到用户信息之后,电子设备可以将用户信息发送至服务器、云端或云服务器等设备,并接收从服务器、云端或云服务器等设备发送图像作为静态图像或动态图像。其中,服务器、云端或云服务器上可以存储有多种风格对应的扩散模型,在接收到从电子设备发送的用户信息时,可以调用对应的扩散模型生成用户信息所指示的风格的静态图像或动态图像。In other embodiments of the present application, in order to improve the operating efficiency of electronic devices, artificial intelligence content generation technology can be deployed in devices such as servers, cloud or cloud servers, and electronic devices can communicate with devices such as servers, cloud or cloud servers through Bluetooth, hotspots, Wi-Fi, etc., so as to obtain static images or dynamic images generated by artificial intelligence content generation technology. For example, after receiving user information, the electronic device can send the user information to devices such as servers, cloud or cloud servers, and receive images sent from devices such as servers, cloud or cloud servers as static images or dynamic images. Among them, the server, cloud or cloud server can store diffusion models corresponding to multiple styles. When receiving user information sent from the electronic device, the corresponding diffusion model can be called to generate a static image or dynamic image of the style indicated by the user information.
在本实施例中,在用户信息包括主题信息和风格信息时,能够准确地生成符合用户需求的静态图像或动态图像。由于用户信息可以由用户自行设置,因此静态图像和动态图像的生成具有灵活性。In this embodiment, when the user information includes theme information and style information, a static image or dynamic image that meets the user's needs can be accurately generated. Since the user information can be set by the user, the generation of static images and dynamic images is flexible.
S13,根据静态图像或动态图像,控制照明设备的灯光效果。S13, controlling the lighting effect of the lighting device according to the static image or the dynamic image.
在本申请的一些实施例中,电子设备根据静态图像,控制照明设备的灯光效果包括:电子设备根据静态图像中每个像素点的像素值,控制每个照明设备或照明设备中每个发光元件的灯光效果,或,根据静态图像中多个像素点的像素值,控制每个照明设备或照明设备中每个发光元件的灯光效果。In some embodiments of the present application, the electronic device controls the lighting effects of a lighting device based on a static image, including: the electronic device controls the lighting effects of each lighting device or each light-emitting element in the lighting device based on the pixel value of each pixel point in the static image, or controls the lighting effects of each lighting device or each light-emitting element in the lighting device based on the pixel values of multiple pixels in the static image.
其中,照明设备可以为灯串、节能灯、投光灯、安防灯、灯带以及屋檐灯等。照明设备可以由多个发光元件组成,例如,若照明设备为多个灯珠组成的灯串,则一个发光元件为灯串的其中一个灯珠。静态图像中每个像素点的像素值可以控制一个照明设备或照明设备中一个发光元件的灯光效果,由于静态图像包括多个像素点的像素值,因此在照明设备为多个或照明设备由多个发光元件组成时,通过静态图像包括多个像素点的像素值,可以实现对每个照明设备或照明设备中每个发光元件的灯光效果的控制。Among them, lighting devices can include light strings, energy-saving lamps, floodlights, security lights, light strips, and eaves lights. A lighting device can be composed of multiple light-emitting elements. For example, if the lighting device is a light string composed of multiple lamp beads, a light-emitting element is one of the lamp beads in the light string. The pixel value of each pixel in a static image can control the lighting effect of a lighting device or a light-emitting element in a lighting device. Because a static image includes the pixel values of multiple pixels, when there are multiple lighting devices or a lighting device is composed of multiple light-emitting elements, the pixel values of multiple pixels in the static image can be used to control the lighting effect of each lighting device or each light-emitting element in the lighting device.
电子设备可以对多个像素点的像素值进行平均或者加权平均计算,并根据平均或加权平均后的像素值控制一个照明设备或照明设备中一个发光元件的灯光效果。平均或加权平均的多个像素点的数量可以自行设置,本申请对此不作限制。在对多个像素点的像素值进行平均或者加权平均计算时,可以对静态图像或动态图像进行区域划分,并对划分之后的每个区域中的像素点的像素值加权平均或者平均,其中,可以采用预训练的图像分割模型对静态图像或动态图像进行区域划分,不同区域中的像素点数量不同,可以对不同区域的像素点进行平均或者加权平均,并根据平均或加权平均后的像素值控制一个照明设备或照明设备中一个发光元件的灯光效果,每个区域中的像素点的数量可以自 行设置,本申请对此不作限制。在照明设备为灯串时,发光元件可以为灯串的其中一个灯珠。生成的静态图像或动态图像可以采用不同的颜色空间,包括RGB(红、绿、蓝)颜色空间、HSL(色调、饱和度、亮度)或HSV(色调、饱和度、明度)等其他颜色空间。The electronic device can average or weighted average the pixel values of multiple pixels, and control the lighting effect of a lighting device or a light-emitting element in the lighting device according to the averaged or weighted averaged pixel values. The number of multiple pixels to be averaged or weighted averaged can be set voluntarily, and this application does not impose any restrictions on this. When averaging or weighted averaging the pixel values of multiple pixels, the static image or dynamic image can be divided into regions, and the pixel values of the pixels in each region after the division can be weighted averaged or averaged, wherein a pre-trained image segmentation model can be used to divide the static image or dynamic image into regions, and the number of pixels in different regions is different. The pixels in different regions can be averaged or weighted averaged, and the lighting effect of a lighting device or a light-emitting element in the lighting device can be controlled according to the averaged or weighted averaged pixel values. The number of pixels in each region can be set voluntarily. The present application does not impose any restrictions on this. When the lighting device is a light string, the light-emitting element can be one of the lamp beads in the light string. The generated static image or dynamic image can use different color spaces, including RGB (red, green, blue) color space, HSL (hue, saturation, brightness) or HSV (hue, saturation, value) and other color spaces.
若生成的静态图像或动态图像为HSL或HSV等其他颜色空间,电子设备可以将静态图像或动态图像从HSL或HSV等颜色空间转换为RGB颜色空间,再根据转换后得到的RGB格式的静态图像或动态图像控制照明设备的灯光效果。静态图像中每个区域的多个像素点平均或加权平均后的像素值可以控制一个照明设备或照明设备中一个发光元件的灯光效果,由于静态图像可以划分为多个区域,因此在照明设备为多个或照明设备由多个发光元件组成时,通过静态图像包括多个像素点的像素值,可以实现对每个照明设备或照明设备中每个发光元件的灯光效果的控制。If the generated static image or dynamic image is in another color space such as HSL or HSV, the electronic device can convert the static image or dynamic image from the HSL or HSV color space to the RGB color space, and then control the lighting effects of the lighting device based on the static image or dynamic image in RGB format obtained after the conversion. The pixel value obtained by averaging or weighted averaging multiple pixels in each area of the static image can control the lighting effects of a lighting device or a light-emitting element in the lighting device. Since the static image can be divided into multiple areas, when there are multiple lighting devices or the lighting device is composed of multiple light-emitting elements, the pixel values of the multiple pixels included in the static image can be used to control the lighting effects of each lighting device or each light-emitting element in the lighting device.
具体地,由于RGB格式的静态图像或动态图像的像素点的每个像素值由红(Red)、绿(Green)、蓝(Blue)三个分量构成,因此RGB格式的静态图像或动态图像的像素值又称为RGB值。照明设备或每个发光元件中包括红、绿、蓝三种颜色对应的发光体,例如发光体可以为发光二极管(Light Emitting Diode,LED)。电子设备通过每个像素值的红、绿、蓝三个分量分配至照明设备或每个发光元件中对应的发光体,从而使得照明设备或者发光元件能够发出静态图像对应的灯光效果。Specifically, since each pixel value of a static image or dynamic image in RGB format is composed of three components: red (Red), green (Green), and blue (Blue), the pixel value of a static image or dynamic image in RGB format is also called an RGB value. A lighting device or each light-emitting element includes light-emitting bodies corresponding to the three colors of red, green, and blue. For example, the light-emitting body can be a light-emitting diode (LED). The electronic device distributes the red, green, and blue components of each pixel value to the corresponding light-emitting body in the lighting device or each light-emitting element, so that the lighting device or light-emitting element can emit a lighting effect corresponding to the static image.
在本申请的其他实施例中,由于动态图像包括多帧图像,电子设备可以根据每帧图像依次控制照明设备的灯光效果,使得照明设备发出动态的灯光效果,其中,根据动态图像的每帧图像控制照明设备的灯光效果的过程与上述根据静态图像,控制照明设备的灯光效果的过程基本相同,根据动态图像控制照明设备的灯光效果的过程与根据静态图像控制照明设备的灯光效果的过程类似,故本申请不再重复描述。In other embodiments of the present application, since the dynamic image includes multiple frames of images, the electronic device can control the lighting effects of the lighting device in sequence according to each frame of the image, so that the lighting device emits a dynamic lighting effect. The process of controlling the lighting effects of the lighting device according to each frame of the dynamic image is basically the same as the above-mentioned process of controlling the lighting effects of the lighting device according to the static image. The process of controlling the lighting effects of the lighting device according to the dynamic image is similar to the process of controlling the lighting effects of the lighting device according to the static image, so this application will not repeat the description.
在本申请的其它实施例中,若用户信息包括声音信息,例如音乐和/或音效等,电子设备可以根据静态图像、动态图像及用户信息中的声音信息控制照明设备的灯光效果。电子设备通过每个像素值的红、绿、蓝三个分量分配至每个照明设备或每个发光元件中对应的发光体,使得照明设备或发光元件发出对应的灯光,并按照音乐和/或音效中的节奏控制灯光发出缓慢流动、闪烁、渐变及扫射等灯光变化效果,使得照明设备或发光元件的灯光效果更符合用户的需求。In other embodiments of the present application, if the user information includes sound information, such as music and/or sound effects, the electronic device can control the lighting effects of the lighting device based on the static image, dynamic image, and sound information in the user information. The electronic device distributes the red, green, and blue components of each pixel value to the corresponding light source in each lighting device or each light-emitting element, causing the lighting device or light-emitting element to emit the corresponding light. The electronic device also controls the light to produce light-changing effects such as slow flow, flashing, gradual change, and sweeping according to the rhythm of the music and/or sound effects, so that the lighting effects of the lighting device or light-emitting element better meet the user's needs.
在本申请的一些实施例中,在静态图像或动态图像的分辨率与照明设备的数量不匹配时,电子设备可以依据照明设备的数量对静态图像和/或动态图像进行缩放处理。例如,若照明设备为灯串,灯珠的数量为520颗,静态图像和/或动态图像的分辨率为512x512,电子设备可以通过最近邻下采样算法将分辨率为512x512的静态图像和/或动态图像下采样至26x20,得到分辨率为26x20的静态图像和/或动态图像,并根据分辨率为26x20的静态图像和/或动态图像控制520颗灯珠的灯光效果。例如,下采样的方法可以为最近邻插值、双线性插值等。图像的分辨率(image resolution)是指图像包括的像素点数量,通常表达为横向的像素点数量x纵向的像素点数量。例如,分辨率为480x800的图像是由横向480个像素点、纵向800个像素点(合计384000个像素点)构成的。In some embodiments of the present application, when the resolution of a static image or a dynamic image does not match the number of lighting devices, the electronic device can scale the static image and/or the dynamic image according to the number of lighting devices. For example, if the lighting device is a light string, the number of lamp beads is 520, and the resolution of the static image and/or the dynamic image is 512x512, the electronic device can downsample the static image and/or the dynamic image with a resolution of 512x512 to 26x20 through a nearest neighbor downsampling algorithm, thereby obtaining a static image and/or a dynamic image with a resolution of 26x20, and control the lighting effects of the 520 lamp beads according to the static image and/or the dynamic image with a resolution of 26x20. For example, the downsampling method can be nearest neighbor interpolation, bilinear interpolation, etc. The resolution of an image refers to the number of pixels included in the image, usually expressed as the number of horizontal pixels x the number of vertical pixels. For example, an image with a resolution of 480x800 is composed of 480 pixels in the horizontal direction and 800 pixels in the vertical direction (a total of 384,000 pixels).
在本申请的其他实施例中,若根据用户信息生成的视频或动态图像过大,可以采用预设编码格式对生成的视频或动态图像进行编码压缩,从而得到预设编码格式的压缩包, 通过解码器对预设编码格式的压缩包进行解码,得到多帧解码图像,根据多帧解码图像控制照明设备的灯光效果。其中,预设编码格式包括但不限于:MPEG-1、MPEG-2、MPEG-4、H.263及H.264等,解码器包括但不限于:H.265、VP9及AV1等视频编解码器中的解码器。根据每帧解码图像控制照明设备的灯光效果的过程与根据静态图像控制照明设备的灯光效果的过程类似,故本申请不再重复描述。通过上述实施方式,获取用户信息,由于用户信息能够反映用户对灯光效果的需求,因此根据用户信息,能够灵活地生成符合用户需求的静态图像或动态图像,从而能够对照明设备进行准确控制。此外,由于能够对照明设备进行准确控制,动态图像能够提供更丰富的灯光效果,因此能够提高用户体验感。In other embodiments of the present application, if the video or dynamic image generated according to the user information is too large, the generated video or dynamic image can be encoded and compressed using a preset encoding format to obtain a compressed package in the preset encoding format. The compressed packet of the preset coding format is decoded by a decoder to obtain multiple frames of decoded images, and the lighting effects of the lighting device are controlled according to the multiple frames of decoded images. The preset coding formats include but are not limited to: MPEG-1, MPEG-2, MPEG-4, H.263 and H.264, and the decoders include but are not limited to: decoders in video codecs such as H.265, VP9 and AV1. The process of controlling the lighting effects of the lighting device according to each frame of the decoded image is similar to the process of controlling the lighting effects of the lighting device according to a static image, so this application will not repeat the description. Through the above embodiment, user information is obtained. Since the user information can reflect the user's demand for lighting effects, static images or dynamic images that meet the user's needs can be flexibly generated according to the user information, so that the lighting device can be accurately controlled. In addition, since the lighting device can be accurately controlled, the dynamic image can provide richer lighting effects, thereby improving the user experience.
在本申请的一些实施例中,在将用户信息输入至扩散模型中,生成静态图像或动态图像之前,可以先对扩散模型对应的扩散网络进行训练,以获取训练后的扩散模型,预训练后的扩散模型更符合用户需求。如图5所示,是本申请一实施例提供的扩散模型的训练方法的流程图。In some embodiments of the present application, before inputting user information into a diffusion model to generate static or dynamic images, the diffusion network corresponding to the diffusion model can be trained to obtain a pre-trained diffusion model. This pre-trained diffusion model can better meet user needs. Figure 5 is a flow chart of a diffusion model training method provided in one embodiment of the present application.
S121,获取训练数据。S121, obtaining training data.
在本申请的一些实施例中,训练数据包括多张训练图像及每张训练图像的描述信息,每张训练图像具有对应的风格。例如,训练图像的风格包括但不限于:写实风格及像素风格等。训练图像中的图像内容可以为表情包(emoji)。In some embodiments of the present application, the training data includes multiple training images and description information for each training image, each training image having a corresponding style. For example, the styles of the training images include, but are not limited to, realistic style and pixel style. The image content in the training images may be emojis.
像素风格的每张训练图像可以是对原始训练图像进行像素化处理得到,具体的像素化过程可以参考下文中的步骤S231-S232。原始训练图像可以从预设数据集中获取,其中,预设数据集可以自行设置,本申请对此不作限制。Each training image of the pixel style can be obtained by pixelating the original training image. The specific pixelation process can be referred to steps S231-S232 below. The original training image can be obtained from a preset dataset, wherein the preset dataset can be set by itself and is not limited in this application.
在本申请的一些实施例中,电子设备可以调用自然语言处理模型对每张训练图像进行识别,得到每张训练图像的描述信息。其中,自然语言处理模型可以自行设置,本申请对此不作限制。例如,自然语言处理模型可以为GPT4-V模型、BLIP模型、BLIP2模型或DeepBooru模型。训练图像的描述信息为对训练图像中的对象的描述,描述信息包括但不限于:词语、短语及句子等。例如,若训练图像中的图像内容为表情包,该训练图像的描述信息可以包括表情、动作及对象等。In some embodiments of the present application, the electronic device may call a natural language processing model to identify each training image and obtain description information of each training image. The natural language processing model may be set by itself, and this application does not limit this. For example, the natural language processing model may be a GPT4-V model, a BLIP model, a BLIP2 model, or a DeepBooru model. The description information of the training image is a description of the object in the training image, and the description information includes but is not limited to: words, phrases, and sentences. For example, if the image content in the training image is an emoticon package, the description information of the training image may include expressions, actions, and objects.
S122,基于模型微调算法,利用训练数据对扩散网络进行调整,得到扩散模型。S122, based on the model fine-tuning algorithm, using the training data to adjust the diffusion network to obtain a diffusion model.
在本申请的一些实施例中,模型微调算法包括,但不限于:低秩自适应算法(Low-Rank Adaption,LoRA)以及DreamBooth等。电子设备基于模型微调算法,利用训练数据对扩散网络进行调整,得到扩散模型的过程与上文中通过扩散模型生成静态图像及动态图像的过程基本相同,故本申请不再重复描述。In some embodiments of the present application, model fine-tuning algorithms include, but are not limited to, Low-Rank Adaption (LoRA) and DreamBooth. The electronic device uses training data to adjust the diffusion network based on the model fine-tuning algorithm to obtain the diffusion model. The process is essentially the same as the process of generating static and dynamic images using the diffusion model described above, and is not repeated in this application.
在本实施例中,在训练完成之后,在用户信息中包括主题信息和风格信息时,扩散模型可以输出对应主题和风格的静态图像或动态图像,或者,在用户信息中仅包括主题信息,不包括风格信息时,扩散模型可以输出对应主题、预设风格的静态图像或动态图像。预设风格可以自行设置,本申请对此不作限制。例如,预设风格可以为写实风格或者像素风格。风格是指图像的视觉风格。In this embodiment, after training is complete, if the user information includes both theme information and style information, the diffusion model can output a static or dynamic image corresponding to the theme and style. Alternatively, if the user information only includes theme information and does not include style information, the diffusion model can output a static or dynamic image corresponding to the theme and a preset style. The preset style can be set voluntarily, and this application does not impose any restrictions on this. For example, the preset style can be a realistic style or a pixel style. Style refers to the visual style of an image.
在本申请的一些实施例中,如图6所示,是本申请另一实施例提供的灯光效果的控制方法的流程图,包括以下步骤:In some embodiments of the present application, as shown in FIG6 , which is a flow chart of a method for controlling lighting effects provided by another embodiment of the present application, the method includes the following steps:
S21,获取用户信息。 S21, obtain user information.
在本申请的一些实施例中,关于用户信息以及用户信息的获取过程可以参考步骤S11,本申请在此不再重复描述。In some embodiments of the present application, the user information and the process of obtaining the user information may refer to step S11, and the present application will not repeat the description here.
S22,根据用户信息生成静态图像或动态图像。S22: Generate a static image or a dynamic image according to the user information.
在本申请的一些实施例中,静态图像及动态图像的生成过程可以参考步骤S12,本申请在此不再重复描述。In some embodiments of the present application, the generation process of static images and dynamic images can refer to step S12, and the present application will not repeat the description here.
S23,对静态图像或动态图像进行像素化处理。S23, performing pixelation processing on the static image or the dynamic image.
在本申请的一些实施例中,电子设备可以基于训练后的图像翻译神经网络模型(Cycle-Consistent Generative Adversarial Network,CycleGAN)对静态图像或动态图像进行像素化处理。In some embodiments of the present application, the electronic device can perform pixelation processing on static images or dynamic images based on a trained image translation neural network model (Cycle-Consistent Generative Adversarial Network, CycleGAN).
其中,训练后的图像翻译神经网络模型学习到了像素化的映射关系。若静态图像或动态图像的分辨率与图像翻译神经网络模型的输入图像所需的分辨率不相同,可以先对静态图像或动态图像进行缩放处理,使得缩放处理后的静态图像或动态图像的分辨率与图像翻译神经网络模型的输入图像所需的分辨率相同。例如,若静态图像或动态图像的分辨率为512x512,图像翻译神经网络模型的输入图像所需的分辨率为256x256,电子设备可以通过对静态图像或动态图像进行下采样,使得下采样后的静态图像或动态图像的分辨率为256x256。Among them, the trained image translation neural network model learns the pixelated mapping relationship. If the resolution of the static image or dynamic image is different from the resolution required by the input image of the image translation neural network model, the static image or dynamic image can be scaled first so that the resolution of the static image or dynamic image after scaling is the same as the resolution required by the input image of the image translation neural network model. For example, if the resolution of the static image or dynamic image is 512x512 and the resolution required by the input image of the image translation neural network model is 256x256, the electronic device can downsample the static image or dynamic image so that the resolution of the downsampled static image or dynamic image is 256x256.
S24,根据像素化处理后的静态图像或动态图像,控制照明设备的灯光效果。S24, controlling the lighting effect of the lighting device according to the pixelated static image or dynamic image.
在本申请的一些实施例中,图像翻译神经网络模型输出的像素化处理后的静态图像或动态图像的分辨率小于输入图像翻译神经网络模型的静态图像或动态图像的分辨率。例如,若输入图像翻译神经网络模型的静态图像或动态图像的分辨率为512x512,图像翻译神经网络模型输出的像素化处理后的静态图像或动态图像的分辨率为256x256。In some embodiments of the present application, the resolution of the pixelated still image or dynamic image output by the image translation neural network model is smaller than the resolution of the still image or dynamic image input to the image translation neural network model. For example, if the resolution of the still image or dynamic image input to the image translation neural network model is 512x512, the resolution of the pixelated still image or dynamic image output by the image translation neural network model is 256x256.
在本申请的其他实施例中,为了与照明设备中的发光元件的数量进行匹配,可以对像素化处理后的静态图像或动态图像进行下采样,并根据下采样后的静态图像或动态图像控制照明设备的灯光效果。例如,若照明设备为窗帘灯,有520颗灯珠,像素化处理后的静态图像或动态图像的分辨率为256x256,电子设备可以通过最近邻下采样算法对像素化处理后的静态图像或动态图像进行下采样,使得下采样后的静态图像或动态图像的分辨率为26x20。或者,若照明设备有1024颗灯珠,像素化处理后的静态图像或动态图像的分辨率为256x256,电子设备可以通过最近邻下采样算法对像素化处理后的静态图像或动态图像进行下采样,使得下采样后的静态图像或动态图像的分辨率为32x32。In other embodiments of the present application, in order to match the number of light-emitting elements in the lighting device, the pixelated static image or dynamic image can be downsampled, and the lighting effect of the lighting device can be controlled based on the downsampled static image or dynamic image. For example, if the lighting device is a curtain light with 520 lamp beads, and the resolution of the pixelated static image or dynamic image is 256x256, the electronic device can downsample the pixelated static image or dynamic image through the nearest neighbor downsampling algorithm, so that the resolution of the downsampled static image or dynamic image is 26x20. Alternatively, if the lighting device has 1024 lamp beads, and the resolution of the pixelated static image or dynamic image is 256x256, the electronic device can downsample the pixelated static image or dynamic image through the nearest neighbor downsampling algorithm, so that the resolution of the downsampled static image or dynamic image is 32x32.
通过人工智能生成内容技术生成的静态图像或动态图像的分辨率与照明设备中的发光元件的数量之间可能会存在不匹配的情况,在生成的静态图像或动态图像中像素点的数量大于照明设备中发光元件的数量时,若直接对生成的静态图像或动态图像进行下采样,可能会导致采样后的静态图像或动态图像出现细节丢失、模糊、色彩失真等问题。通过采样后的静态图像或动态图像控制照明设备的灯光效果,可能会导致灯光效果不准确以及灯光效果与用户信息之间不匹配等问题。在本实施例中,通过图像翻译神经网络模型对静态图像或动态图像进行像素化处理,由于图像翻译神经网络模型学习到了像素化之间的映射关系,并且能够输出比原始的静态图像或动态图像的分辨率更小的像素化后的静态图像或动态图像,因此能够减少细节丢失、模糊、色彩失真,从而能够确保灯光效果准确性以及灯光效果与用户信息之间的适配性。上述图像翻译神经网络模型仅为 示例,实际应用中还可以为其他网络模型。There may be a mismatch between the resolution of static images or dynamic images generated by artificial intelligence content generation technology and the number of light-emitting elements in the lighting device. When the number of pixels in the generated static image or dynamic image is greater than the number of light-emitting elements in the lighting device, if the generated static image or dynamic image is directly downsampled, it may cause the sampled static image or dynamic image to have problems such as detail loss, blurring, and color distortion. Controlling the lighting effects of the lighting device through the sampled static image or dynamic image may cause problems such as inaccurate lighting effects and mismatch between the lighting effects and user information. In this embodiment, the static image or dynamic image is pixelated by an image translation neural network model. Since the image translation neural network model learns the mapping relationship between pixelation and can output a pixelated static image or dynamic image with a smaller resolution than the original static image or dynamic image, it can reduce detail loss, blurring, and color distortion, thereby ensuring the accuracy of the lighting effect and the adaptability between the lighting effect and user information. The above-mentioned image translation neural network model is only Examples, other network models can also be used in actual applications.
在本申请的一些实施例中,在使用图像翻译神经网络模型进行像素化处理之前,需要预先对图像翻译神经网络进行训练,使得训练后的图像翻译神经网络模型能够学习到像素化的映射关系,从而能够输出像素化处理后的图像。如图7所示,是本申请一实施例提供的图像翻译神经网络模型的训练方法的流程图,具体包括以下步骤:In some embodiments of the present application, before using the image translation neural network model for pixelation processing, the image translation neural network needs to be trained in advance so that the trained image translation neural network model can learn the pixelation mapping relationship and thus output the pixelated image. As shown in Figure 7, it is a flow chart of the training method of the image translation neural network model provided in one embodiment of the present application, which specifically includes the following steps:
S231,构造像素化数据集。S231, constructing a pixelated dataset.
在本申请的一些实施例中,电子设备构造像素化数据集包括:电子设备获取多张原始图像,其中,每张原始图像的图像分辨率与图像翻译神经网络的输入图像所需的分辨率相同,并通过滤波器对每张原始图像进行下采样,得到预设分辨率的图像,电子设备通过插值算法对预设分辨率的图像进行上采样,使得上采样后的图像的分辨率与图像翻译神经网络的输入图像所需的分辨率相同,将上采样后的图像确定为所述每张原始图像对应的像素化图像,并将多张原始图像及每张原始图像对应的像素化图像确定为像素化数据集中的图像数据。In some embodiments of the present application, constructing a pixelated data set by an electronic device includes: the electronic device acquiring multiple original images, wherein the image resolution of each original image is the same as the resolution required for the input image of the image translation neural network, and downsampling each original image through a filter to obtain an image of a preset resolution, the electronic device upsampling the image of the preset resolution through an interpolation algorithm so that the resolution of the upsampled image is the same as the resolution required for the input image of the image translation neural network, determining the upsampled image as the pixelated image corresponding to each original image, and determining the multiple original images and the pixelated image corresponding to each original image as image data in the pixelated data set.
其中,滤波器和插值算法均可以自行设置,本申请对此不作限制。例如,滤波器可以为Lanczos滤波器,插值算法可以为最近邻插值算法。预设分辨率可以自行设置,本申请对此不作限制。例如,预设分辨率可以为80x80、64x64、48x48、32x32、16x16等。通过滤波器对每张原始图像进行下采样可以是随机的。每张像素化图像的风格为像素风格,关于对像素风格的介绍可以参考步骤S11,本申请不再重复描述。Among them, the filter and interpolation algorithm can be set by yourself, and this application does not impose any restrictions on this. For example, the filter can be a Lanczos filter, and the interpolation algorithm can be a nearest neighbor interpolation algorithm. The preset resolution can be set by yourself, and this application does not impose any restrictions on this. For example, the preset resolution can be 80x80, 64x64, 48x48, 32x32, 16x16, etc. The downsampling of each original image by the filter can be random. The style of each pixelated image is a pixel style. For an introduction to the pixel style, please refer to step S11, and this application will not repeat the description.
例如,原始图像的图像分辨率与图像翻译神经网络的输入图像所需的分辨率均为256x256,电子设备可以通过Lanczos滤波器将每张原始图像下采样至分辨率64x64,得到64x64的图像,通过最近邻插值算法对64x64的图像上采样至256x256,得到每张原始图像对应的像素化图像,将多张原始图像及每张原始图像对应的像素化图像确定为像素化数据集中的图像数据。For example, the image resolution of the original image and the resolution required for the input image of the image translation neural network are both 256x256. The electronic device can downsample each original image to a resolution of 64x64 through a Lanczos filter to obtain a 64x64 image, and upsample the 64x64 image to 256x256 through a nearest neighbor interpolation algorithm to obtain a pixelated image corresponding to each original image. The multiple original images and the pixelated image corresponding to each original image are determined as image data in the pixelated dataset.
在本申请的一些实施例中,若原始图像的分辨率与图像翻译神经网络的输入图像所需的分辨率不相同,电子设备可以通过对原始图像进行缩放,使得缩放后的原始图像的分辨率与图像翻译神经网络的输入图像所需的分辨率相同,其中,可以通过多种方法对原始图像进行缩放,本申请对缩放方式不作限制。例如,承接上述实施例,若原始图像的图像分辨率为128x128,图像翻译神经网络的输入图像所需的分辨率为256x256,电子设备可以通过双线性插值将每张原始图像的分辨率由128x128缩放至256x256。In some embodiments of the present application, if the resolution of the original image is different from the resolution required by the input image of the image translation neural network, the electronic device can scale the original image so that the resolution of the scaled original image is the same as the resolution required by the input image of the image translation neural network. The original image can be scaled by a variety of methods, and the present application does not limit the scaling method. For example, continuing with the above embodiment, if the image resolution of the original image is 128x128 and the resolution required by the input image of the image translation neural network is 256x256, the electronic device can scale the resolution of each original image from 128x128 to 256x256 through bilinear interpolation.
S232,基于像素化数据集中的每张原始图像及每张原始图像的像素化图像,对图像翻译神经网络进行训练,得到图像翻译神经网络模型。S232: Based on each original image in the pixelated data set and the pixelated image of each original image, train the image translation neural network to obtain an image translation neural network model.
在本申请的一些实施例中,在对图像翻译神经网络进行训练的过程中,图像翻译神经网络学习如何将原始图像的风格转化或映射为像素风格或写实风格,使得训练完成的图像翻译神经网络模型可以直接将任一图像的风格转换为像素风格或写实风格。在用户信息中仅包括主题信息,不包括风格信息时,扩散模型可以输出对应主题、预设风格的静态图像或动态图像。预设风格可以自行设置,本申请对此不作限制。例如,预设风格可以为写实风格或者像素风格。风格是指图像的视觉风格。In some embodiments of the present application, during the training of the image translation neural network, the image translation neural network learns how to convert or map the style of the original image into a pixel style or a realistic style, so that the trained image translation neural network model can directly convert the style of any image into a pixel style or a realistic style. When the user information only includes subject information but does not include style information, the diffusion model can output a static image or a dynamic image corresponding to the subject and preset style. The preset style can be set by yourself, and this application does not impose any restrictions on this. For example, the preset style can be a realistic style or a pixel style. Style refers to the visual style of an image.
在本申请的一些实施例中,电子设备可以通过对抗式训练方法,根据像素化数据集中的每张原始图像及每张原始图像的像素化图像,对图像翻译神经网络进行训练。在训 练过程中,图像翻译神经网络包括两组生成对抗式网络,每组生成对抗式网络均包括生成器及鉴别器。为了便于说明对抗式网络的训练过程,以下将一组对抗式网络的生成器及鉴别器分别称为第一生成器以及第一鉴别器,并将另一组对抗式网络的生成器及鉴别器分别称为第二生成器以及第二鉴别器。In some embodiments of the present application, the electronic device can train the image translation neural network based on each original image and the pixelated image of each original image in the pixelated dataset through an adversarial training method. During training, the image translation neural network consists of two generative adversarial networks (GANs), each consisting of a generator and a discriminator. To facilitate the training of the GANs, the generator and discriminator of one GAN are referred to as the first generator and the first discriminator, respectively, and the generator and discriminator of the other GAN are referred to as the second generator and the second discriminator, respectively.
在对第一生成器及第一鉴别器进行训练的过程中,电子设备调用第一生成器依据每张原始图像,生成对应的像素风格的第一生成图像,并根据每张原始图像对应的像素化图像及第一生成图像之间的差异计算第一生成器的第一损失值,并通过第一损失值调整第一生成器,电子设备调用第一鉴别器对每张第一生成图像进行鉴别,输出第一鉴别结果,根据第一鉴别结果与第一预设标签之间的差异计算第一鉴别器的第二损失值,并通过第二损失值调整第一鉴别器。其中,第一鉴别结果可以为指示输入的第一生成图像为真和假的标签,例如,当使用1表示鉴别为真(鉴定第一生成图像并非由第一生成器生成),使用0表示鉴别为假(鉴定第一生成图像由第一生成器生成)时,第一鉴别结果可以为0或1,第一预设标签表示可以为0。预设条件可以自行设置,本申请对此不作限制。由于第一预设标签表示鉴定为假的标签,在根据第一预设标签计算第一鉴别器的第二损失值时,可以将第一鉴别结果与第一预设标签之间的差异作为衡量第一鉴别器判定准确性的依据。通过最小化这个差异来调整第一鉴别器的参数,能够提高第一鉴别器对第一生成图像的真实性的判断能力。During the training of the first generator and the first discriminator, the electronic device calls the first generator to generate a first generated image of a corresponding pixel style based on each original image, and calculates a first loss value of the first generator based on the difference between the pixelated image corresponding to each original image and the first generated image, and adjusts the first generator based on the first loss value. The electronic device calls the first discriminator to identify each first generated image, outputs a first identification result, calculates a second loss value of the first discriminator based on the difference between the first identification result and the first preset label, and adjusts the first discriminator based on the second loss value. The first identification result can be a label indicating whether the input first generated image is true or false. For example, when 1 is used to indicate true identification (identification of the first generated image not generated by the first generator) and 0 is used to indicate false identification (identification of the first generated image generated by the first generator), the first identification result can be 0 or 1, and the first preset label can be 0. The preset conditions can be set voluntarily and are not limited in this application. Since the first preset label indicates a label identified as false, when calculating the second loss value of the first discriminator based on the first preset label, the difference between the first identification result and the first preset label can be used as a basis for measuring the accuracy of the first discriminator's judgment. By minimizing this difference to adjust the parameters of the first discriminator, the ability of the first discriminator to judge the authenticity of the first generated image can be improved.
在对第一生成器及第一鉴别器进行训练的过程中,第一生成器和第一鉴别器具有相反的训练目标和相反的损失。第一生成器的训练目标是根据每张原始图像,生成与该原始图像的像素化图像相似的第一生成图像使得第一鉴别器无法区分。第一鉴别器的训练目标是准确区分第一生成器生成的第一生成图像与对应的像素化图像。During the training of the first generator and the first discriminator, the first generator and the first discriminator have opposite training objectives and opposite losses. The training objective of the first generator is to generate a first generated image that is similar to the pixelated version of each original image, such that the first discriminator cannot distinguish it. The training objective of the first discriminator is to accurately distinguish the first generated image generated by the first generator from the corresponding pixelated image.
在对第二生成器及第二鉴别器进行训练的过程中,电子设备调用第二生成器依据每张原始图像对应的像素化图像,生成该原始图像对应的第二生成图像,并根据每张原始图像与对应的第二生成图像之间的差异计算第二生成器的第三损失值,并通过第三损失值调整第二生成器,电子设备调用第二鉴别器对每张第二生成图像进行鉴别,输出第二鉴别结果,根据第二鉴别结果与第二预设标签之间的差异计算第二鉴别器的第四损失值,并通过第四损失值调整第二鉴别器。其中,第二鉴别结果可以为指示输入的第二生成图像为真和假的标签。例如,当使用1表示鉴别为真(鉴定第二生成图像并非由第二生成器生成),使用0表示鉴别为假(鉴定第二生成图像由第二生成器生成)时,第二鉴别结果可以为0或1,第二预设标签表示可以为0。预设条件可以自行设置,本申请对此不作限制。由于第二预设标签表示鉴定为假的标签,在根据第二预设标签计算第二鉴别器的第四损失值时,可以将第二鉴别结果与第二预设标签之间的差异作为衡量第二鉴别器判定准确性的依据。通过最小化这个差异来调整第二鉴别器的参数,能够提高第二鉴别器对第二生成图像的真实性的判断能力。During the training process of the second generator and the second discriminator, the electronic device invokes the second generator to generate a second generated image corresponding to each original image based on the pixelated image corresponding to the original image. The electronic device calculates a third loss value for the second generator based on the difference between each original image and the corresponding second generated image, and adjusts the second generator based on the third loss value. The electronic device invokes the second discriminator to perform authentication on each second generated image, outputs a second authentication result, calculates a fourth loss value for the second discriminator based on the difference between the second authentication result and the second preset label, and adjusts the second discriminator based on the fourth loss value. The second authentication result may be a label indicating whether the input second generated image is true or false. For example, when 1 is used to indicate authentication as true (authentication of the second generated image not being generated by the second generator) and 0 is used to indicate authentication as false (authentication of the second generated image being generated by the second generator), the second authentication result may be 0 or 1, and the second preset label may be 0. The preset conditions can be set voluntarily and are not limited in this application. Since the second preset label indicates a label for authentication as false, when calculating the fourth loss value for the second discriminator based on the second preset label, the difference between the second authentication result and the second preset label may be used as a basis for measuring the accuracy of the second discriminator's judgment. By minimizing this difference and adjusting the parameters of the second discriminator, the ability of the second discriminator to judge the authenticity of the second generated image can be improved.
在对第二生成器及第二鉴别器进行训练的过程中,第二生成器和第二鉴别器具有相反的训练目标和相反的损失。第二生成器的训练目标是根据每张原始图像对应的像素化图像,生成与该原始图像相似的第二生成图像使得第二鉴别器无法区分。第二鉴别器的训练目标是准确区分第二生成器生成的第二生成图像与对应的原始图像。During the training of the second generator and the second discriminator, the second generator and the second discriminator have opposite training objectives and opposite losses. The training objective of the second generator is to generate a second generated image similar to the original image based on the pixelated image corresponding to each original image, so that the second discriminator cannot distinguish the second generated image. The training objective of the second discriminator is to accurately distinguish the second generated image generated by the second generator from the corresponding original image.
在第一生成器与第二生成器的交替训练过程中,电子设备调用第一生成器对第二生 成器生成的每张第二生成图像进行转换,得到每张像素化图像对应的第三生成图像,根据每张像素化图像与对应的第三生成图像与计算第五损失值,并根据第五损失值调整第一生成器,电子设备调用第二生成器对第一生成器生成的每张第一生成图像进行转换,得到每张原始图像对应的第四生成图像,电子设备根据每张原始图像与对应的第四生成图像计算第六损失值,并根据第六损失值调整第二生成器。During the alternating training process between the first generator and the second generator, the electronic device calls the first generator to train the second generator. The electronic device converts each second generated image generated by the generator to obtain a third generated image corresponding to each pixelated image, calculates a fifth loss value based on each pixelated image and the corresponding third generated image, and adjusts the first generator based on the fifth loss value. The electronic device calls the second generator to convert each first generated image generated by the first generator to obtain a fourth generated image corresponding to each original image. The electronic device calculates a sixth loss value based on each original image and the corresponding fourth generated image, and adjusts the second generator based on the sixth loss value.
其中,在所有的损失值均满足对应的预设条件时,不再调整,将调整后的第一生成器确定为第一生成器模型,将调整后的第二生成器确定为第二生成器模型,训练得到的图像翻译神经网络模型可以包括第一生成器模型及第二生成器模型,预设条件可以自行设置,本申请对此不作限制。例如,预设条件可以为损失值不再变化,或者连续的多个损失值之间的变化幅度处于预设范围,预设范围可以自行设置,本申请对称不作限制。Among them, when all loss values meet the corresponding preset conditions, no further adjustment is made, and the adjusted first generator is determined as the first generator model, and the adjusted second generator is determined as the second generator model. The trained image translation neural network model may include the first generator model and the second generator model. The preset conditions can be set arbitrarily, and this application does not impose any restrictions on this. For example, the preset condition may be that the loss value no longer changes, or that the amplitude of change between multiple consecutive loss values is within a preset range. The preset range can be set arbitrarily, and this application does not impose any restrictions on symmetry.
在本实施例中,第一生成器与第二生成器的方向相反,第一鉴别器与第二鉴别器的方向相反,这样的结构可以实现像素化(Pixelization),也可以实现反像素化(Depixelization)。通过对第一生成器进行训练,使得训练后的第一生成器模型能够学习到像素化的映射关系。在需要静态图像或动态图像进行像素化处理时,电子设备可以调用第一生成器模型对静态图像或动态图像进行像素化处理,得到像素化处理后的静态图像或动态图像。通过对第二生成器进行训练,使得训练后的第二生成器模型能够学习到反像素化的映射关系。在需要像素化图像需要进行反像素化处理时,电子设备可以调用第二生成器模型对像素化图像进行反像素化处理,得到反像素化处理后的图像。In this embodiment, the first generator is in opposite directions to the second generator, and the first discriminator is in opposite directions to the second discriminator. Such a structure can realize pixelation (Pixelization) and depixelation (Depixelization). By training the first generator, the trained first generator model can learn the pixelation mapping relationship. When a static image or a dynamic image needs to be pixelated, the electronic device can call the first generator model to perform pixelation processing on the static image or the dynamic image to obtain a static image or a dynamic image after pixelation processing. By training the second generator, the trained second generator model can learn the depixelation mapping relationship. When a pixelated image needs to be depixelated, the electronic device can call the second generator model to perform depixelation processing on the pixelated image to obtain an image after depixelation processing.
如图8所示,是本申请一实施例提供的灯光效果控制装置的功能模块图。灯光效果控制装置11包括获取单元110、生成单元111以及控制单元112。本申请所称的模块/单元是指一种能够被图9中的处理器103所获取,并且能够完成固定功能的一系列计算机可读指令段,其存储在图9中的存储器102中。在本实施例中,关于各模块/单元的功能将在后续的实施例中详述。Figure 8 shows a functional block diagram of a lighting effect control device according to one embodiment of the present application. The lighting effect control device 11 includes an acquisition unit 110, a generation unit 111, and a control unit 112. A module/unit as referred to herein refers to a series of computer-readable instruction segments that can be acquired by the processor 103 in Figure 9 and perform a fixed function, and is stored in the memory 102 in Figure 9. The functions of each module/unit in this embodiment will be described in detail in subsequent embodiments.
获取单元110,用于获取用户信息。The acquiring unit 110 is configured to acquire user information.
在本申请的一些实施例中,用户信息包括文本、视频、图像及声音中的至少一种。In some embodiments of the present application, the user information includes at least one of text, video, image, and sound.
生成单元111,用于根据用户信息生成静态图像或动态图像。The generating unit 111 is configured to generate a static image or a dynamic image according to user information.
在本申请的一些实施例中,若用户信息包括主题信息,生成单元111,还用于根据预设风格生成主题信息的对应主题的静态图像或动态图像,若用户信息包括主题信息和风格信息,生成单元111,还用于根据风格信息对应的风格,生成主题信息对应的主题的静态图像或动态图像。In some embodiments of the present application, if the user information includes theme information, the generation unit 111 is further used to generate a static image or dynamic image of the theme corresponding to the theme information according to a preset style. If the user information includes theme information and style information, the generation unit 111 is further used to generate a static image or dynamic image of the theme corresponding to the theme information according to the style corresponding to the style information.
在本申请的一些实施例中,生成单元111,还用于基于人工智能生成内容技术对用户信息进行处理,生成静态图像或动态图像。In some embodiments of the present application, the generation unit 111 is further configured to process user information based on artificial intelligence content generation technology to generate static images or dynamic images.
在本申请的一些实施例中,生成单元111,还用于将用户信息输入至扩散模型中,生成静态图像或动态图像。In some embodiments of the present application, the generating unit 111 is further configured to input user information into a diffusion model to generate a static image or a dynamic image.
控制单元112,用于根据静态图像或动态图像,控制照明设备的灯光效果。The control unit 112 is configured to control the lighting effects of the lighting device according to static images or dynamic images.
在本申请的一些实施例中,控制单元112,还用于对静态图像或动态图像进行像素化处理,并根据像素化处理后的静态图像或动态图像,控制照明设备的灯光效果。In some embodiments of the present application, the control unit 112 is further configured to perform pixelation processing on a static image or a dynamic image, and control a lighting effect of a lighting device according to the pixelated static image or dynamic image.
在本申请的一些实施例中,控制单元112,还用于基于图像翻译神经网络模型对静态图像或动态图像进行像素化处理。 In some embodiments of the present application, the control unit 112 is further configured to perform pixelation processing on a static image or a dynamic image based on an image translation neural network model.
在本申请的一些实施例中,控制单元112,还用于根据静态图像中每个像素点的像素值,控制每个照明设备或照明设备中每个发光元件的灯光效果,或,根据静态图像中多个像素点的像素值,控制每个照明设备或照明设备中每个发光元件的灯光效果。In some embodiments of the present application, the control unit 112 is further used to control the lighting effect of each lighting device or each light-emitting element in the lighting device according to the pixel value of each pixel point in the static image, or to control the lighting effect of each lighting device or each light-emitting element in the lighting device according to the pixel values of multiple pixel points in the static image.
在本申请的一些实施例中,动态图像包括多帧静态图像,控制单元112,还用于根据动态图像中每帧静态图像的每个像素点的像素值,控制每个照明设备或照明设备中每个发光元件的灯光效果,或,根据动态图像中每帧静态图像的多个像素点的像素值,控制每个照明设备或照明设备中每个发光元件的灯光效果。In some embodiments of the present application, the dynamic image includes multiple frames of static images, and the control unit 112 is further used to control the lighting effect of each lighting device or each light-emitting element in the lighting device according to the pixel value of each pixel point of each static image frame in the dynamic image, or to control the lighting effect of each lighting device or each light-emitting element in the lighting device according to the pixel values of multiple pixel points of each static image frame in the dynamic image.
如图9所示,是本申请一实施例提供的电子设备的结构示意图。如图9所示,该电子设备10可以包括通信模块101、存储器102、处理器103、输入/输出(Input/Output,I/O)接口104及总线105。处理器103通过总线105分别耦合于通信模块101、存储器102、输入/输出接口104。Figure 9 is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application. As shown in Figure 9, the electronic device 10 may include a communication module 101, a memory 102, a processor 103, an input/output (I/O) interface 104, and a bus 105. The processor 103 is coupled to the communication module 101, the memory 102, and the input/output interface 104 via the bus 105.
通信模块101可以包括有线通信模块和/或无线通信模块。有线通信模块可以提供通用串行总线(universal serial bus,USB)、控制器局域网总线(CAN,Controller Area Network)等有线通信的解决方案中的一种或多种。无线通信模块可以提供无线保真(wireless fidelity,Wi-Fi),蓝牙(Bluetooth,BT),移动通信网络,调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案中的一种或多种。The communication module 101 may include a wired communication module and/or a wireless communication module. The wired communication module may provide one or more wired communication solutions such as universal serial bus (USB) and controller area network (CAN). The wireless communication module may provide one or more wireless communication solutions such as wireless fidelity (Wi-Fi), Bluetooth (BT), mobile communication network, frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc.
存储器102可以包括一个或多个随机存取存储器(random access memory,RAM)和一个或多个非易失性存储器(non-volatile memory,NVM)。随机存取存储器可以由处理器103直接进行读写,可以用于存储或其他正在运行中的程序的可执行程序(例如机器指令),还可以用于存储用户及应用的数据等。随机存取存储器可以包括静态随机存储器(static random-access memory,SRAM)、动态随机存储器(dynamic random access memory,DRAM)、同步动态随机存储器(synchronous dynamic random access memory,SDRAM)、双倍资料率同步动态随机存取存储器(double data rate synchronous dynamic random access memory,DDR SDRAM)等。The memory 102 may include one or more random access memories (RAMs) and one or more non-volatile memories (NVMs). The RAM can be directly read and written by the processor 103 and can be used to store executable programs (e.g., machine instructions) of other running programs, as well as user and application data. The RAM may include static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), etc.
非易失性存储器也可以存储可执行程序和存储用户及应用的数据等,可以提前加载到随机存取存储器中,用于处理器103直接进行读写。非易失性存储器可以包括磁盘存储器件、快闪存储器(flash memory)。Non-volatile memory can also store executable programs and user and application data, etc., and can be pre-loaded into random access memory for direct reading and writing by processor 103. Non-volatile memory can include disk storage devices and flash memory.
存储器102用于存储一个或多个计算机程序。一个或多个计算机程序被配置为被处理器103执行。该一个或多个计算机程序包括多个指令,多个指令被处理器103执行时,可实现在电子设备10上执行的灯光效果控制方法。The memory 102 is used to store one or more computer programs. The one or more computer programs are configured to be executed by the processor 103. The one or more computer programs include multiple instructions. When the multiple instructions are executed by the processor 103, the lighting effect control method executed on the electronic device 10 can be implemented.
在其他实施例中,如图9所示的电子设备10还包括外部存储器接口,用于连接外部的存储器,实现扩展电子设备10的存储能力。In other embodiments, the electronic device 10 shown in FIG. 9 further includes an external memory interface for connecting to an external memory to expand the storage capacity of the electronic device 10 .
处理器103可以包括一个或多个处理单元,例如:处理器103可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 103 may include one or more processing units. For example, the processor 103 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), and/or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
处理器103提供计算和控制能力,例如,处理器103用于执行存储器102内存储的 计算机程序,以实现上述的灯光效果控制方法。The processor 103 provides computing and control capabilities. For example, the processor 103 is used to execute the programs stored in the memory 102. Computer program to implement the above-mentioned lighting effect control method.
输入/输出接口104用于提供用户输入或输出的通道,例如输入/输出接口104可用于连接各种输入输出设备,例如,鼠标、键盘、触控装置、显示屏等,使得用户可以录入信息,或者使信息可视化。The input/output interface 104 is used to provide a channel for user input or output. For example, the input/output interface 104 can be used to connect various input and output devices, such as a mouse, keyboard, touch device, display screen, etc., so that the user can enter information or visualize information.
总线105至少用于提供电子设备10中的通信模块101、存储器102、处理器103、输入/输出接口104之间相互通信的通道。The bus 105 is at least used to provide a channel for mutual communication among the communication module 101 , the memory 102 , the processor 103 , and the input/output interface 104 in the electronic device 10 .
可以理解的是,本申请实施例示意的结构并不构成对电子设备10的具体限定。在本申请另一些实施例中,电子设备10可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 10. In other embodiments of the present application, the electronic device 10 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
本申请实施例还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序中包括程序指令,程序指令被执行时所实现的方法可参照本申请上述各个实施例中的方法。An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions. The method implemented when the program instructions are executed can refer to the methods in the above-mentioned embodiments of the present application.
其中,计算机可读存储介质可以是上述实施例所述的电子设备的内部存储器,例如电子设备的硬盘或内存。计算机可读存储介质也可以是电子设备的外接存储设备,例如电子设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。The computer-readable storage medium may be the internal memory of the electronic device described in the above embodiments, such as the hard disk or memory of the electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash memory card, etc.
在一些实施例中,计算机可读存储介质可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据电子设备的使用所创建的数据等。In some embodiments, the computer-readable storage medium may include a program storage area and a data storage area, wherein the program storage area may store an operating system, applications required for at least one function, etc.; the data storage area may store data created according to the use of the electronic device, etc.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
在本申请所提供的实施例中,应该理解到,所揭露的装置/电子设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/电子设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in the present application, it should be understood that the disclosed devices/electronic devices and methods can be implemented in other ways. For example, the device/electronic device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或 者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。 The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, it should be understood by those skilled in the art that the technical solutions described in the above embodiments can still be modified, or some of the technical features thereof can be replaced by equivalents. The replacement of the above-mentioned technical solutions does not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of this application, and should be included in the protection scope of this application.
Claims (11)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2024/074329 WO2025156293A1 (en) | 2024-01-26 | 2024-01-26 | Light-effect control method and apparatus, and electronic device and storage medium |
| AU2024278389A AU2024278389A1 (en) | 2024-01-26 | 2024-01-26 | Method for controlling lighting effects, electronic device and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2024/074329 WO2025156293A1 (en) | 2024-01-26 | 2024-01-26 | Light-effect control method and apparatus, and electronic device and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025156293A1 true WO2025156293A1 (en) | 2025-07-31 |
Family
ID=96544212
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/074329 Pending WO2025156293A1 (en) | 2024-01-26 | 2024-01-26 | Light-effect control method and apparatus, and electronic device and storage medium |
Country Status (2)
| Country | Link |
|---|---|
| AU (1) | AU2024278389A1 (en) |
| WO (1) | WO2025156293A1 (en) |
Citations (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20130294050A1 (en) * | 2012-05-07 | 2013-11-07 | Hongkyu LEE | Lighting apparatus having an audio device and method of controlling the same |
| US20140091731A1 (en) * | 2012-09-28 | 2014-04-03 | Panasonic Corporation | Lighting system |
| CN113613363A (en) * | 2020-12-11 | 2021-11-05 | 萤火虫(深圳)灯光科技有限公司 | Lighting control method, device, controller, module and storage medium |
| CN113778299A (en) * | 2021-08-11 | 2021-12-10 | 深圳市智岩科技有限公司 | Control method, device, electronic device and storage medium for lighting equipment |
| CN114126135A (en) * | 2021-12-23 | 2022-03-01 | 深圳市迈捷物联光电有限公司 | Intelligent interaction system for lamplight video pictures, intelligent interaction control method for lamplight video pictures and television |
| CN114340102A (en) * | 2021-12-31 | 2022-04-12 | 深圳创维-Rgb电子有限公司 | Lamp strip control method and device, display equipment and system and storage medium |
| CN115767844A (en) * | 2021-09-03 | 2023-03-07 | 深圳市智岩科技有限公司 | Lamp effect control method and related equipment thereof |
| CN115884471A (en) * | 2022-12-30 | 2023-03-31 | 深圳市千岩科技有限公司 | Lamp effect control method and device, equipment, medium and product thereof |
| CN116997062A (en) * | 2023-09-22 | 2023-11-03 | 深圳市千岩科技有限公司 | Control method, device, lighting structure and computer storage medium |
| CN117261748A (en) * | 2023-10-18 | 2023-12-22 | 北京集度科技有限公司 | Control method and device for vehicle lamplight, electronic equipment and storage medium |
| CN117440574A (en) * | 2023-12-18 | 2024-01-23 | 深圳市千岩科技有限公司 | Light screen equipment and lighting effect generation methods and corresponding devices and media |
-
2024
- 2024-01-26 WO PCT/CN2024/074329 patent/WO2025156293A1/en active Pending
- 2024-01-26 AU AU2024278389A patent/AU2024278389A1/en active Pending
Patent Citations (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20130294050A1 (en) * | 2012-05-07 | 2013-11-07 | Hongkyu LEE | Lighting apparatus having an audio device and method of controlling the same |
| US20140091731A1 (en) * | 2012-09-28 | 2014-04-03 | Panasonic Corporation | Lighting system |
| CN113613363A (en) * | 2020-12-11 | 2021-11-05 | 萤火虫(深圳)灯光科技有限公司 | Lighting control method, device, controller, module and storage medium |
| CN113778299A (en) * | 2021-08-11 | 2021-12-10 | 深圳市智岩科技有限公司 | Control method, device, electronic device and storage medium for lighting equipment |
| CN115767844A (en) * | 2021-09-03 | 2023-03-07 | 深圳市智岩科技有限公司 | Lamp effect control method and related equipment thereof |
| CN114126135A (en) * | 2021-12-23 | 2022-03-01 | 深圳市迈捷物联光电有限公司 | Intelligent interaction system for lamplight video pictures, intelligent interaction control method for lamplight video pictures and television |
| CN114340102A (en) * | 2021-12-31 | 2022-04-12 | 深圳创维-Rgb电子有限公司 | Lamp strip control method and device, display equipment and system and storage medium |
| CN115884471A (en) * | 2022-12-30 | 2023-03-31 | 深圳市千岩科技有限公司 | Lamp effect control method and device, equipment, medium and product thereof |
| CN116997062A (en) * | 2023-09-22 | 2023-11-03 | 深圳市千岩科技有限公司 | Control method, device, lighting structure and computer storage medium |
| CN117261748A (en) * | 2023-10-18 | 2023-12-22 | 北京集度科技有限公司 | Control method and device for vehicle lamplight, electronic equipment and storage medium |
| CN117440574A (en) * | 2023-12-18 | 2024-01-23 | 深圳市千岩科技有限公司 | Light screen equipment and lighting effect generation methods and corresponding devices and media |
Also Published As
| Publication number | Publication date |
|---|---|
| AU2024278389A1 (en) | 2025-08-14 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10938725B2 (en) | Load balancing multimedia conferencing system, device, and methods | |
| Lukac | Computational photography: methods and applications | |
| US11670015B2 (en) | Method and apparatus for generating video | |
| US11581020B1 (en) | Facial synchronization utilizing deferred neural rendering | |
| US11918412B2 (en) | Generating a simulated image of a baby | |
| KR102353556B1 (en) | Apparatus for Generating Facial expressions and Poses Reappearance Avatar based in User Face | |
| CN114821734A (en) | Method and device for driving expression of virtual character | |
| JP2023539620A (en) | Facial image processing method, display method, device and computer program | |
| WO2022022043A1 (en) | Head image generation method, apparatus, server, and storage medium | |
| WO2023284401A1 (en) | Image beautification processing method and apparatus, storage medium, and electronic device | |
| CN113542758B (en) | Generative Adversarial Neural Network-Assisted Video Compression and Broadcasting | |
| CN115222899B (en) | Virtual digital human generation method, system, computer equipment and storage medium | |
| WO2024140246A1 (en) | Digital cartoon character avatar generation method and apparatus, electronic device, and medium | |
| CN118711113A (en) | Image processing method, device, equipment, medium and program product | |
| CN111968191A (en) | Automatic image synthesis using a comb neural network architecture | |
| CN116152888A (en) | A method for quickly generating virtual human dynamic business cards based on ultra-short video samples | |
| WO2025156293A1 (en) | Light-effect control method and apparatus, and electronic device and storage medium | |
| CN116664700A (en) | An image processing method and device | |
| CN114627211A (en) | Video business card generation method, device, computer equipment and storage medium | |
| CN119400152A (en) | A multimodal digital human generation method and system | |
| WO2025007761A1 (en) | Method for providing digital human, system, and computing device cluster | |
| CN114549281A (en) | Image processing method, image processing device, electronic equipment and storage medium | |
| KR20060040118A (en) | Custom 3D animation production method and device and its distribution system | |
| KR20230163907A (en) | Systen and method for constructing converting model for cartoonizing image into character image, and image converting method using the converting model | |
| KR102809162B1 (en) | Emotional face-talking video generation system using reference identity image, text and audio and method thereof |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| ENP | Entry into the national phase |
Ref document number: 2024278389 Country of ref document: AU Date of ref document: 20240126 Kind code of ref document: A |
|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 24919391 Country of ref document: EP Kind code of ref document: A1 |