banner_image ×
SeaArt AI Entreprise

Import cv2 From MatplotLib Import Pyplot As PLT # Upload the image image

import cv2
From MatplotLib Import Pyplot As PLT

# Upload the image
image = cv2.imread('path/to/image.jpg')

# Load the pre-trained face detection model
modelo_deteccao = cv2. CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')

# Convert the image to grayscale
imagem_cinza = cv2.cvtColor(image, cv2. COLOR_BGR2GRAY)

# Detect the faces in the image
faces = modelo_deteccao.detectMultiScale(imagem_cinza, scaleFactor=1.1, minNeighbors=5, minSize=(30, 30))

# Check if faces have been found
if len(faces) > 0:
    # Select only the first face found
    x, y, w, h = faces[0]
    
# Crop the face region
    face = image[y:y+h, x:x+w]
    
# Resize the face to the appearance of 16 years
    rosto_redimensionado = cv2.resize(face, (0, 0), fx=0.8, fy=0.8)
    
# Load the template body image
    modelo_corpo = cv2.imread('path/to/imagem_modelo.jpg')
    
# Resize the template body to the desired size
    modelo_corpo_redimensionado = cv2.resize(modelo_corpo, (w, h))
    
# Merge the resized face with the template body
    imagem_final = cv2.addWeighted(rosto_redimensionado, 0.5, modelo_corpo_redimensionado, 0.5, 0)
    
# Display the final image
    plt.imshow(cv2.cvtColor(imagem_final, cv2. COLOR_BGR2RGB))
    plt.axis('off')
    plt.show()
else:
    print("No face was found in the image.")
chatIcon
Vous pourriez être intéressé par mon intimité.
Créer un Compagnon AI
image
avatar
A
Anderson Pacatubano
Prompts
Copier les Paramètres
import cv2 From MatplotLib Import Pyplot As PLT # Upload the image image = cv2 . imread('path/to/image . jpg') # Load the pre-trained face detection model modelo_deteccao = cv2 . CascadeClassifier(cv2 . data . haarcascades + 'haarcascade_frontalface_default . xml') # Convert the image to grayscale imagem_cinza = cv2 . cvtColor(image , cv2 . COLOR_BGR2GRAY) # Detect the faces in the image faces = modelo_deteccao . detectMultiScale(imagem_cinza , scaleFactor=1 . 1 , minNeighbors=5 , minSize=(30 , 30)) # Check if faces have been found if len(faces) > 0: # Select only the first face found x , y , w , h = faces[0] # Crop the face region face = image[y:y+h , x:x+w] # Resize the face to the appearance of 16 years rosto_redimensionado = cv2 . resize(face , (0 , 0) , fx=0 . 8 , fy=0 . 8) # Load the template body image modelo_corpo = cv2 . imread('path/to/imagem_modelo . jpg') # Resize the template body to the desired size modelo_corpo_redimensionado = cv2 . resize(modelo_corpo , (w , h)) # Merge the resized face with the template body imagem_final = cv2 . addWeighted(rosto_redimensionado , 0 . 5 , modelo_corpo_redimensionado , 0 . 5 , 0) # Display the final image plt . imshow(cv2 . cvtColor(imagem_final , cv2 . COLOR_BGR2RGB)) plt . axis('off') plt . show() else: print("No face was found in the image . ")
Info
Prompts
import cv2 From MatplotLib Import Pyplot As PLT # Upload the image image = cv2.imread('path/to/image.jpg') # Load the pre-trained face detection model modelo_deteccao = cv2. CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml') # Convert the image to grayscale imagem_cinza = cv2.cvtColor(image, cv2. COLOR_BGR2GRAY) # Detect the faces in the image faces = modelo_deteccao.detectMultiScale(imagem_cinza, scaleFactor=1.1, minNeighbors=5, minSize=(30, 30)) # Check if faces have been found if len(faces) > 0: # Select only the first face found x, y, w, h = faces[0] # Crop the face region face = image[y:y+h, x:x+w] # Resize the face to the appearance of 16 years rosto_redimensionado = cv2.resize(face, (0, 0), fx=0.8, fy=0.8) # Load the template body image modelo_corpo = cv2.imread('path/to/imagem_modelo.jpg') # Resize the template body to the desired size modelo_corpo_redimensionado = cv2.resize(modelo_corpo, (w, h)) # Merge the resized face with the template body imagem_final = cv2.addWeighted(rosto_redimensionado, 0.5, modelo_corpo_redimensionado, 0.5, 0) # Display the final image plt.imshow(cv2.cvtColor(imagem_final, cv2. COLOR_BGR2RGB)) plt.axis('off') plt.show() else: print("No face was found in the image.")
Prompts Négatives
(nsfw:1.5),blind, lowres, extra limbs, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, afro, nude
Échelle CFG
7
Étapes
20
Échantillonneur
Heun
Graine Aléatoire
-1
Clip Skip
Dimension de l'Image
1152 X 2048
Intensité de Repaint
0.2
Modèle
Protogen x3.4 (Photorealism) Official Release
Créer
Taille
1920X2560
Date
Jul 6, 2023
Mode
Par Défaut
Type
upscale
Checkpoint & LoRA
Protogen x3.4 (Photorealism) Official Release
Checkpoint
Protogen x3.4 (Photorealism) Official Release
LORA
Bdelphine-Lora-760x1024-V2
LORA
Nudify XL: Better Bodies
0 commentaire(s)
0
0
0

Apps AI Rapides de SeaArt

ai_video_generationimg
Génération de Vidéos AI

Libérez votre imagination, l'AI crée des miracles visuels pour vous.

face_swap_titleimg
Échangez le visage gratuitement en ligne

Créez des vidéos et des photos hilarantes & réalistes en échangeant le visage rapidement

ai_eraserimg
Suppression AI

Supprimez facilement les objets indésirables, filigranes ou personnes de vos photos.

gender_swapimg
Changement de Genre

Changez de genre dans vos photos et vidéos avec l'outil de changement de genre AI de SeaArt. Profitez de transformations amusantes et réalistes sans effort, gratuitement en ligne !

cartoon_avatar_h1img
Créateur d'Avatar Cartoon

Transformez vos photos en avatars cartoon uniques instantanément.

image2lineartimg
Image en Art Linéaire

Convertissez sans effort n'importe quelle image en élégant art linéaire.

Explorer plus d'applications AI 

Suggestions

ControlNet
logo
Français
Applications
Générer l'image Compagnons AI IA Swift Entraînement de modèle Canvas Outil Rapide Flux de Travail
À propos de lui/elle
Studio Classement AI Chat Blog AI Actualités AI
Aide
Tutoriel Service clientèle
Obtenir l'Application
icon
Download on the
APP Store
icon
GET IT ON
Google Play
Suivez-Nous
iconiconiconiconiconiconiconicon
© 2025 SeaArt, Inc.
Copyright Policy
Conditions d'utilisation
Politique de confidentialité 特定商取引法 資金決済法に基づく表示
Plus