jolibrain / joliGEN

Generative AI Image Toolset with GANs and Diffusion for Real-World Applications
https://www.joligen.com
Other
238 stars 31 forks source link

fix: correct help for image generation scripts #599

Closed Bycob closed 7 months ago

Bycob commented 8 months ago
usage: gen_single_image_diffusion.py --model_in_file MODEL_IN_FILE --img_in IMG_IN --dir_out DIR_OUT [--name NAME] [--img_width IMG_WIDTH] [--img_height IMG_HEIGHT] [--cpu] [--gpuid GPUID]               
                                     [--crop_width CROP_WIDTH] [--crop_height CROP_HEIGHT] [--bbox_width_factor BBOX_WIDTH_FACTOR] [--bbox_height_factor BBOX_HEIGHT_FACTOR]                               
                                     [--sampling_steps SAMPLING_STEPS] [--seed SEED] [--mask_delta MASK_DELTA [MASK_DELTA ...]] [--mask_delta_ratio MASK_DELTA_RATIO [MASK_DELTA_RATIO ...]]               
                                     [--mask_square] [--sampling_method {ddpm,ddim}] [--cls_value CLS_VALUE] [--previous_frame PREVIOUS_FRAME] [--mask_in MASK_IN] [--ref-in REF_IN] [--bbox_in BBOX_IN]   
                                     [--nb_samples NB_SAMPLES] [--bbox_ref_id BBOX_REF_ID] [--cond_in COND_IN] [--cond_keep_ratio] [--cond_rotation COND_ROTATION]                                         
                                     [--cond_persp_horizontal COND_PERSP_HORIZONTAL] [--cond_persp_vertical COND_PERSP_VERTICAL] [--min_crop_bbox_ratio MIN_CROP_BBOX_RATIO]                               
                                     [--alg_diffusion_cond_image_creation {y_t,previous_frame,sketch,canny,depth,hed,hough,low_res,sam,pix2pix}]                                                           
                                     [--alg_diffusion_guidance_scale ALG_DIFFUSION_GUIDANCE_SCALE]                                                                                                         
                                     [--alg_diffusion_sketch_canny_thresholds ALG_DIFFUSION_SKETCH_CANNY_THRESHOLDS [ALG_DIFFUSION_SKETCH_CANNY_THRESHOLDS ...]]                                           
                                     [--alg_diffusion_super_resolution_downsample] [--alg_diffusion_sam_use_gaussian_filter] [--alg_diffusion_sam_no_sobel_filter]                                         
                                     [--alg_diffusion_sam_no_output_binary_sam] [--alg_diffusion_sam_redundancy_threshold ALG_DIFFUSION_SAM_REDUNDANCY_THRESHOLD]                                          
                                     [--alg_diffusion_sam_sobel_threshold ALG_DIFFUSION_SAM_SOBEL_THRESHOLD] [--alg_diffusion_sam_final_canny]                                                             
                                     [--alg_diffusion_sam_min_mask_area ALG_DIFFUSION_SAM_MIN_MASK_AREA] [--alg_diffusion_sam_max_mask_area ALG_DIFFUSION_SAM_MAX_MASK_AREA]                               
                                     [--alg_diffusion_sam_points_per_side ALG_DIFFUSION_SAM_POINTS_PER_SIDE] [--alg_diffusion_sam_no_sample_points_in_ellipse]                                             
                                     [--alg_diffusion_sam_crop_delta ALG_DIFFUSION_SAM_CROP_DELTA] [--model_prior_321_backwardcompatibility] [--alg_palette_ddim_num_steps ALG_PALETTE_DDIM_NUM_STEPS]     
                                     [--alg_palette_ddim_eta ALG_PALETTE_DDIM_ETA] [--f_s_weight_sam F_S_WEIGHT_SAM] [--data_refined_mask]                                                                 

optional arguments:                                                                                                                                                                                        
  --model_in_file MODEL_IN_FILE                                                                                                                                                                            
                        file path to generator model (.pth file) (default: None)                                                                                                                           
  --img_in IMG_IN       image to transform (default: None)                                                                                                                                                 
  --dir_out DIR_OUT     The directory where to output result images (default: None)                                                                                                                        
  --name NAME           generated img name (default: img)                                                                                                                                                  
  --img_width IMG_WIDTH                                                                                                                                                                                    
                        image width, defaults to model crop size (default: -1)                                                                                                                             
  --img_height IMG_HEIGHT                                                                                                                                                                                  
                        image height, defaults to model crop size (default: -1)                                                                                                                            
  --cpu                 whether to use CPU (default: False)                                                                                                                                                
  --gpuid GPUID         which GPU to use (default: 0)                                                                                                                                                      
  --crop_width CROP_WIDTH                                                                                                                                                                                  
                        crop width added on each side of the bbox (optional) (default: -1)                                                                                                                 
  --crop_height CROP_HEIGHT                                                                                                                                                                                
                        crop height added on each side of the bbox (optional) (default: -1)                                                                                                                
  --bbox_width_factor BBOX_WIDTH_FACTOR                                                                                                                                                                    
                        bbox width added factor of original width (default: 0.0)                                                                                                                           
  --bbox_height_factor BBOX_HEIGHT_FACTOR                                                                                                                                                                  
                        bbox height added factor of original height (default: 0.0)                                                                                                                         
  --sampling_steps SAMPLING_STEPS                                                                                                                                                                          
                        number of sampling steps (default: -1)                                                                                                                                             
  --seed SEED           random seed for reproducibility (default: -1)                                                                                                                                      
  --mask_delta MASK_DELTA [MASK_DELTA ...]                                                                                                                                                                 
                        mask offset to allow generation of a bigger object, format : width (x) height (y) for each class or only one size if square (default: [[0]])                                       
  --mask_delta_ratio MASK_DELTA_RATIO [MASK_DELTA_RATIO ...]                                                                                                                                               
                        ratio mask offset to allow generation of a bigger object, format : width (x),height (y) for each class or only one size if square (default: [[0]])                                 
  --mask_square         whether to use square mask (default: False)
    --sampling_method {ddpm,ddim}                                                                                                                                                                            
                        choose the sampling method between ddpm and ddim (default: ddpm)                                                                                                                   
  --cls_value CLS_VALUE                                                                                                                                                                                    
                        override input bbox classe for generation (default: -1)                                                                                                                            
  --previous_frame PREVIOUS_FRAME
                        image to transform (default: None)
  --mask_in MASK_IN     mask used for image transformation (default: None)
  --ref-in REF_IN       image used as reference (default: None)
  --bbox_in BBOX_IN     bbox file used for masking (default: None)
  --nb_samples NB_SAMPLES
                        nb of samples generated (default: 1)
  --bbox_ref_id BBOX_REF_ID
                        bbox id to use (default: -1)
  --cond_in COND_IN     conditionning image to use (default: None)
  --cond_keep_ratio
  --cond_rotation COND_ROTATION
  --cond_persp_horizontal COND_PERSP_HORIZONTAL
  --cond_persp_vertical COND_PERSP_VERTICAL
  --min_crop_bbox_ratio MIN_CROP_BBOX_RATIO
                        minimum crop/bbox ratio, allows to add context when bbox is larger than crop (default: None)
  --alg_diffusion_cond_image_creation {y_t,previous_frame,sketch,canny,depth,hed,hough,low_res,sam,pix2pix}
                        how cond_image is created (default: None)
  --alg_diffusion_guidance_scale ALG_DIFFUSION_GUIDANCE_SCALE
                        scale for classifier-free guidance, default is conditional DDPM only (default: 0.0)
  --alg_diffusion_sketch_canny_thresholds ALG_DIFFUSION_SKETCH_CANNY_THRESHOLDS [ALG_DIFFUSION_SKETCH_CANNY_THRESHOLDS ...]
                        Canny thresholds (default: [0, 765])
  --alg_diffusion_super_resolution_downsample
                        whether to downsample the image for super resolution (default: False)
  --alg_diffusion_sam_use_gaussian_filter
                        whether to apply a gaussian blur to each SAM masks (default: False)
  --alg_diffusion_sam_no_sobel_filter
                        whether to not use a Sobel filter on each SAM masks (default: True)
  --alg_diffusion_sam_no_output_binary_sam
                        whether to not output binary sketch before Canny (default: True)
  --alg_diffusion_sam_redundancy_threshold ALG_DIFFUSION_SAM_REDUNDANCY_THRESHOLD
                        redundancy threshold above which redundant masks are not kept (default: 0.62) 
  --alg_diffusion_sam_sobel_threshold ALG_DIFFUSION_SAM_SOBEL_THRESHOLD
                        sobel threshold in % of gradient magnitude (default: 0.7)
  --alg_diffusion_sam_final_canny
                        whether to perform a Canny edge detection on sam sketch to soften the edges (default: False)
  --alg_diffusion_sam_min_mask_area ALG_DIFFUSION_SAM_MIN_MASK_AREA
                        minimum area in proportion of image size for a mask to be kept (default: 0.001)
  --alg_diffusion_sam_max_mask_area ALG_DIFFUSION_SAM_MAX_MASK_AREA
                        maximum area in proportion of image size for a mask to be kept (default: 0.99)
  --alg_diffusion_sam_points_per_side ALG_DIFFUSION_SAM_POINTS_PER_SIDE
                        number of points per side of image to prompt SAM with (# of prompted points will be points_per_side**2) (default: 16)
  --alg_diffusion_sam_no_sample_points_in_ellipse
                        whether to not sample the points inside an ellipse to avoid the corners of the image (default: True)
  --alg_diffusion_sam_crop_delta ALG_DIFFUSION_SAM_CROP_DELTA
                        extend crop's width and height by 2*crop_delta before computing masks (default: True)
  --model_prior_321_backwardcompatibility
                        whether to load models from previous version of JG. (default: False)
  --alg_palette_ddim_num_steps ALG_PALETTE_DDIM_NUM_STEPS
                        number of steps for ddim sampling method (default: 10)
  --alg_palette_ddim_eta ALG_PALETTE_DDIM_ETA
                        eta parameter for ddim variance (default: 0.5)
  --f_s_weight_sam F_S_WEIGHT_SAM
                        path to sam weight for f_s, e.g. models/configs/sam/pretrain/sam_vit_b_01ec64.pth (default: models/configs/sam/pretrain/sam_vit_b_01ec64.pth)
  --data_refined_mask   whether to use refined mask with sam (default: False)