Skip to content

Changing body structure of an image of a person wearing a dress to body structure of another using key point detection and seam carving algorithms.

License

Notifications You must be signed in to change notification settings

SOUMEE2000/Dress-Sizing

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

To change the body type of one person to body type of another person given two images

Set-I

Set-II

Workflow

Requirements

  • OpenCV
  • scipy
  • numba
  • numpy
  • mediapie

Usage

pip install -r requirements.txt
python seam_carving.py (-resize) -im1 <IM_PATH> -im2 <IM_PATH> 
                         -out <OUTPUT_IM_NAME> [-dx <DX>] 

Description of parameters:

  • -im1: The path to the image to change.
  • -im2: The path of the target image.
  • -out: The name for the output image.
  • '-dx- : Number of pixels to remove. Positive for adding pixels, negative for subtracting pixels. Optional. If not present number of pixels gets calculated.

Algorithm used:

  1. Mediapie library used for key point detection
  2. Left and right shoulders detected, distances between shoulder measured. Say distance between lt and rt shoulder for person 1 is 15 while for person 2 it is 20. So if 5 pixels are removed from the middle of the person then we get person 2 looking like person 1
  3. The difference in above distance, the number of pixels removed as the seam through an algorithm called seam carving algorithm

Key-point Detection

To detect essential features of the images to determine by what amount to reduce or increase the width of the given image

Seam-carving Algorithm

An effective method to resize images by removing pixels without cropping images or resulting in loss of information

Acknowledgements

Many parts of the code are adapted/optimized versions of functionality from other implementations:

About

Changing body structure of an image of a person wearing a dress to body structure of another using key point detection and seam carving algorithms.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%