diff --git a/.gitattributes b/.gitattributes index 30d94648fb252d10531392b4c464cebf9dd9dfc1..c7d2bea4390fff5b6e3e0c110c6fcb6d8424fc48 100644 --- a/.gitattributes +++ b/.gitattributes @@ -638,3 +638,173 @@ ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/menu_layer_utility.jpg filter=lfs ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/mask_invert.jpg filter=lfs diff=lfs merge=lfs -text ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1280x720car.jpg filter=lfs diff=lfs merge=lfs -text ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1280x720_seven_person.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1344x768_girl2.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1344x768_beach.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1344x768_hair.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1920x1080table.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/mask_grow_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/512x512.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/768x1344_beach.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/3840x2160car.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/whl/hydra_core-1.3.2-py3-none-any.whl filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/768x1344_dress.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1344x768_redcar.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1280x768_city.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/girl_dino_1024.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-BlackItalic-1413vuen.woff2 filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Black-jiII8dog.woff2 filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-ExtraBoldItalic-BJafRE5I.woff2 filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-ExtraBold-TduDdwUu.woff2 filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-ExtraLightItalic-ZptecSuc.woff2 filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-ExtraLight-w5HAp5iF.woff2 filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Italic-f6M78thn.woff2 filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-BoldItalic-dE_gZyur.woff2 filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-LightItalic-fu56_DRc.woff2 filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Light-DFhX0qo-.woff2 filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Regular-dEFHw1tF.woff2 filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-SemiBoldItalic-uIDb7hsH.woff2 filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-MediumItalic-zr3roggP.woff2 filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/kofi_button_black-XI_Dr2zg.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Thin-eKObIkJC.woff2 filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-SemiBold-PyS8DO2L.woff2 filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/workflow/catvton_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Medium-dDRaJ8tM.woff2 filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/fox_512x512.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/mask_gradient_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/workflow/girl.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle_Advance/workflow/1344x768_beach.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/demo/demo.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/outer_glow_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/object_detector_yolo_world_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Bold-srYz_-1B.woff2 filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/pixel_spread_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/phi_prompt_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/person_mask_ultra_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/person_mask_ultra_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/phi_prompt_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/prompt_tagger_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/prompt_embellish_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/purge_vram_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/prompt_tagger_example1.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/rembg_ultra_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/random_generator_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/random_generator_v2_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/qwen_image2prompt_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/queue_stop_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/random_generator_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sam2_video_ultra_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sd3_negative_conditioning_node_note.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sd3_negative_conditioning_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sam2_ultra_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/saveimage_plus_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sam2_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_clothes_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_fashion_pipeline_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_clothes_pipeline_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_ultra_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segment_anything_ultra_compare.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segment_anything_ultra_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/shadow_and_highlight_mask_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_ultra_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sharp_and_soft_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segment_anything_ultra_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/simple_text_image_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-ThinItalic-L6uBn3RP.woff2 filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/skin_beauty_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_fashion_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/stroke_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/switch_case_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/text_image_v2_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/text_image_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/ultra_v2_nodes_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/string_condition_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/title.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/text_image_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/text_join_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/transparent_background_ultra_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/ultra_nodes.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/userprompt_generator_txt2img_with_reference_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/vqa_prompt_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/watermark_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/blend_mode_v2_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/water_color_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/yolov8_detect_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/xy2percent_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/birefnet_ultra_v2_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/simple_text_image_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/blend_mode_result.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/channel_shake_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/blendif_mask_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_adapter_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/colormap_result.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_image_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segment_anything_ultra_v2_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_overlay_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_balance_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_of_shadow_and_highlight_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_of_shadow_and_highlight_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/corp_by_mask_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/create_gradient_mask_example2.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/create_gradient_mask_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_temperature_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/corp_by_mask_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/data_nodes_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/draw_bbox_mask_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/drop_shadow_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/soft_light_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/extend_canvas_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/evf_sam_ultra_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/extend_canvas_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/exposure_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/evf_sam_ultra_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/film_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/film_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/florence2_ultra_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/mask_edge_shrink_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/gaussian_blur_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/get_color_tone_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/get_main_color_and_color_name_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/vqa_prompt_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/gradient_image_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/get_main_colors_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/gradient_overlay_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/if_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/hl_frequency_detail_restore_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/human_parts_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_auto_crop_v3_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/human_parts_ultra_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/hdr_effects_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/get_color_tone_v2_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_auto_crop_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_auto_crop_v2_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_auto_crop_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_channel_merge_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-kjnodes/fonts/FreeMono.ttf filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_blend_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-kjnodes/fonts/FreeMonoBoldOblique.otf filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_blend_advance_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/data/DemoDataset/global_pic/demo.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_blend_advance_node.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-kjnodes/fonts/TTNorms-Black.otf filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-kjnodes/docs/images/2024-04-03_20_49_29-ComfyUI.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/inpaint.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-blur-65.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-blur-17.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-input.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-neutral.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-inpaint-cropandstitch/example_workflows/inpaint_flux.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-telea.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-mat.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-navier-stokes.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-lama.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-inpaint-cropandstitch/example_workflows/inpaint_hires.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_channel_split_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-impact-pack/example_workflows/2-MaskDetailer.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-inpaint-cropandstitch/example_workflows/inpaint_sd15.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/florence2_image2prompt_example.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-impact-pack/example_workflows/4-MakeTileSEGS-Upscale.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-impact-pack/example_workflows/5-prompt-per-tile.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-impact-pack/example_workflows/6-DetailerWildcard.jpg filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-impact-pack/troubleshooting/black1.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/comfyui-impact-pack/troubleshooting/black2.png filter=lfs diff=lfs merge=lfs -text +ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/mask_by_different_node.jpg filter=lfs diff=lfs merge=lfs -text diff --git a/ComfyUI/.ci/windows_base_files/run_nvidia_gpu.bat b/ComfyUI/.ci/windows_base_files/run_nvidia_gpu.bat new file mode 100644 index 0000000000000000000000000000000000000000..274d7c9486e0ee182ef8fbe16d34ca95e05e90ec --- /dev/null +++ b/ComfyUI/.ci/windows_base_files/run_nvidia_gpu.bat @@ -0,0 +1,2 @@ +.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build +pause diff --git a/ComfyUI/.ci/windows_base_files/run_nvidia_gpu_fast_fp16_accumulation.bat b/ComfyUI/.ci/windows_base_files/run_nvidia_gpu_fast_fp16_accumulation.bat new file mode 100644 index 0000000000000000000000000000000000000000..38f06ecb2418b05c4b0e88de0711801c22bcb31b --- /dev/null +++ b/ComfyUI/.ci/windows_base_files/run_nvidia_gpu_fast_fp16_accumulation.bat @@ -0,0 +1,2 @@ +.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --fast fp16_accumulation +pause diff --git a/ComfyUI/.ci/windows_nightly_base_files/run_nvidia_gpu_fast.bat b/ComfyUI/.ci/windows_nightly_base_files/run_nvidia_gpu_fast.bat new file mode 100644 index 0000000000000000000000000000000000000000..ca6d6868af4e19fb9ee764241030451d0d15f42d --- /dev/null +++ b/ComfyUI/.ci/windows_nightly_base_files/run_nvidia_gpu_fast.bat @@ -0,0 +1,2 @@ +.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --fast +pause diff --git a/ComfyUI/comfy/text_encoders/t5_pile_tokenizer/tokenizer.model b/ComfyUI/comfy/text_encoders/t5_pile_tokenizer/tokenizer.model new file mode 100644 index 0000000000000000000000000000000000000000..6c00c742ce03c627d6cd5b795984876fa49fa899 --- /dev/null +++ b/ComfyUI/comfy/text_encoders/t5_pile_tokenizer/tokenizer.model @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347 +size 499723 diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/data/DemoDataset/global_pic/demo.jpg b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/data/DemoDataset/global_pic/demo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..00fb531395cd96e3a6d9796f0f55527e1624da88 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/data/DemoDataset/global_pic/demo.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d3b60b137bd2955a5a4fbd2f1168446edbaca8ce9286af8c3ea87bbf83cb9ff +size 139077 diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/demo/demo.jpg b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/demo/demo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..00fb531395cd96e3a6d9796f0f55527e1624da88 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/demo/demo.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d3b60b137bd2955a5a4fbd2f1168446edbaca8ce9286af8c3ea87bbf83cb9ff +size 139077 diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/dev/packaging/build_all_wheels.sh b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/dev/packaging/build_all_wheels.sh new file mode 100644 index 0000000000000000000000000000000000000000..8547c547ff4648b6be26a4611fef1f376f984ef4 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/dev/packaging/build_all_wheels.sh @@ -0,0 +1,57 @@ +#!/bin/bash -e +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved + +PYTORCH_VERSION=1.5 + +build_for_one_cuda() { + cu=$1 + + case "$cu" in + cu*) + container_name=manylinux-cuda${cu/cu/} + ;; + cpu) + container_name=manylinux-cuda101 + ;; + *) + echo "Unrecognized cu=$cu" + exit 1 + ;; + esac + + echo "Launching container $container_name ..." + + for py in 3.6 3.7 3.8; do + docker run -itd \ + --name $container_name \ + --mount type=bind,source="$(pwd)",target=/detectron2 \ + pytorch/$container_name + + cat < + + (diff to make it use the same hyperparameters - click to expand) + + + ```diff + diff --git i/mrcnn/model.py w/mrcnn/model.py + index 62cb2b0..61d7779 100644 + --- i/mrcnn/model.py + +++ w/mrcnn/model.py + @@ -2367,8 +2367,8 @@ class MaskRCNN(): + epochs=epochs, + steps_per_epoch=self.config.STEPS_PER_EPOCH, + callbacks=callbacks, + - validation_data=val_generator, + - validation_steps=self.config.VALIDATION_STEPS, + + #validation_data=val_generator, + + #validation_steps=self.config.VALIDATION_STEPS, + max_queue_size=100, + workers=workers, + use_multiprocessing=True, + diff --git i/mrcnn/parallel_model.py w/mrcnn/parallel_model.py + index d2bf53b..060172a 100644 + --- i/mrcnn/parallel_model.py + +++ w/mrcnn/parallel_model.py + @@ -32,6 +32,7 @@ class ParallelModel(KM.Model): + keras_model: The Keras model to parallelize + gpu_count: Number of GPUs. Must be > 1 + """ + + super().__init__() + self.inner_model = keras_model + self.gpu_count = gpu_count + merged_outputs = self.make_parallel() + diff --git i/samples/coco/coco.py w/samples/coco/coco.py + index 5d172b5..239ed75 100644 + --- i/samples/coco/coco.py + +++ w/samples/coco/coco.py + @@ -81,7 +81,10 @@ class CocoConfig(Config): + IMAGES_PER_GPU = 2 + + # Uncomment to train on 8 GPUs (default is 1) + - # GPU_COUNT = 8 + + GPU_COUNT = 8 + + BACKBONE = "resnet50" + + STEPS_PER_EPOCH = 50 + + TRAIN_ROIS_PER_IMAGE = 512 + + # Number of classes (including background) + NUM_CLASSES = 1 + 80 # COCO has 80 classes + @@ -496,29 +499,10 @@ if __name__ == '__main__': + # *** This training schedule is an example. Update to your needs *** + + # Training - Stage 1 + - print("Training network heads") + model.train(dataset_train, dataset_val, + learning_rate=config.LEARNING_RATE, + epochs=40, + - layers='heads', + - augmentation=augmentation) + - + - # Training - Stage 2 + - # Finetune layers from ResNet stage 4 and up + - print("Fine tune Resnet stage 4 and up") + - model.train(dataset_train, dataset_val, + - learning_rate=config.LEARNING_RATE, + - epochs=120, + - layers='4+', + - augmentation=augmentation) + - + - # Training - Stage 3 + - # Fine tune all layers + - print("Fine tune all layers") + - model.train(dataset_train, dataset_val, + - learning_rate=config.LEARNING_RATE / 10, + - epochs=160, + - layers='all', + + layers='3+', + augmentation=augmentation) + + elif args.command == "evaluate": + ``` + + diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/notes/changelog.md b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/notes/changelog.md new file mode 100644 index 0000000000000000000000000000000000000000..06544665240f53f35942bfff5ea84039f4c3eb08 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/notes/changelog.md @@ -0,0 +1,26 @@ +# Change Log + +### Releases +See release log at +[https://github.com/facebookresearch/detectron2/releases](https://github.com/facebookresearch/detectron2/releases). + +### Notable Backward Incompatible Changes: + +* 03/30/2020: Custom box head's `output_size` changed to `output_shape`. +* 02/14/2020,02/18/2020: Mask head and keypoint head now include logic for losses & inference. Custom heads + should overwrite the feature computation by `layers()` method. +* 11/11/2019: `detectron2.data.detection_utils.read_image` transposes images with exif information. + +### Config Version Change Log + +* v1: Rename `RPN_HEAD.NAME` to `RPN.HEAD_NAME`. +* v2: A batch of rename of many configurations before release. + +### Silent Regression in Historical Versions: + +We list a few silent regressions since they may silently produce incorrect results and will be hard to debug. + +* 04/01/2020 - 05/11/2020: Bad accuracy if `TRAIN_ON_PRED_BOXES` is set to True. +* 03/30/2020 - 04/01/2020: ResNets are not correctly built. +* 12/19/2019 - 12/26/2019: Using aspect ratio grouping causes a drop in accuracy. +* release - 11/9/2019: Test time augmentation does not predict the last category. diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/notes/compatibility.md b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/notes/compatibility.md new file mode 100644 index 0000000000000000000000000000000000000000..859948ccdc32450897a93f893fa646b9bed75974 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/notes/compatibility.md @@ -0,0 +1,83 @@ +# Compatibility with Other Libraries + +## Compatibility with Detectron (and maskrcnn-benchmark) + +Detectron2 addresses some legacy issues left in Detectron. As a result, their models +are not compatible: +running inference with the same model weights will produce different results in the two code bases. + +The major differences regarding inference are: + +- The height and width of a box with corners (x1, y1) and (x2, y2) is now computed more naturally as + width = x2 - x1 and height = y2 - y1; + In Detectron, a "+ 1" was added both height and width. + + Note that the relevant ops in Caffe2 have [adopted this change of convention](https://github.com/pytorch/pytorch/pull/20550) + with an extra option. + So it is still possible to run inference with a Detectron2-trained model in Caffe2. + + The change in height/width calculations most notably changes: + - encoding/decoding in bounding box regression. + - non-maximum suppression. The effect here is very negligible, though. + +- RPN now uses simpler anchors with fewer quantization artifacts. + + In Detectron, the anchors were quantized and + [do not have accurate areas](https://github.com/facebookresearch/Detectron/issues/227). + In Detectron2, the anchors are center-aligned to feature grid points and not quantized. + +- Classification layers have a different ordering of class labels. + + This involves any trainable parameter with shape (..., num_categories + 1, ...). + In Detectron2, integer labels [0, K-1] correspond to the K = num_categories object categories + and the label "K" corresponds to the special "background" category. + In Detectron, label "0" means background, and labels [1, K] correspond to the K categories. + +- ROIAlign is implemented differently. The new implementation is [available in Caffe2](https://github.com/pytorch/pytorch/pull/23706). + + 1. All the ROIs are shifted by half a pixel compared to Detectron in order to create better image-feature-map alignment. + See `layers/roi_align.py` for details. + To enable the old behavior, use `ROIAlign(aligned=False)`, or `POOLER_TYPE=ROIAlign` instead of + `ROIAlignV2` (the default). + + 1. The ROIs are not required to have a minimum size of 1. + This will lead to tiny differences in the output, but should be negligible. + +- Mask inference function is different. + + In Detectron2, the "paste_mask" function is different and should be more accurate than in Detectron. This change + can improve mask AP on COCO by ~0.5% absolute. + +There are some other differences in training as well, but they won't affect +model-level compatibility. The major ones are: + +- We fixed a [bug](https://github.com/facebookresearch/Detectron/issues/459) in + Detectron, by making `RPN.POST_NMS_TOPK_TRAIN` per-image, rather than per-batch. + The fix may lead to a small accuracy drop for a few models (e.g. keypoint + detection) and will require some parameter tuning to match the Detectron results. +- For simplicity, we change the default loss in bounding box regression to L1 loss, instead of smooth L1 loss. + We have observed that this tends to slightly decrease box AP50 while improving box AP for higher + overlap thresholds (and leading to a slight overall improvement in box AP). +- We interpret the coordinates in COCO bounding box and segmentation annotations + as coordinates in range `[0, width]` or `[0, height]`. The coordinates in + COCO keypoint annotations are interpreted as pixel indices in range `[0, width - 1]` or `[0, height - 1]`. + Note that this affects how flip augmentation is implemented. + + +We will later share more details and rationale behind the above mentioned issues +about pixels, coordinates, and "+1"s. + + +## Compatibility with Caffe2 + +As mentioned above, despite the incompatibilities with Detectron, the relevant +ops have been implemented in Caffe2. +Therefore, models trained with detectron2 can be converted in Caffe2. +See [Deployment](../tutorials/deployment.md) for the tutorial. + +## Compatibility with TensorFlow + +Most ops are available in TensorFlow, although some tiny differences in +the implementation of resize / ROIAlign / padding need to be addressed. +A working conversion script is provided by [tensorpack FasterRCNN](https://github.com/tensorpack/tensorpack/tree/master/examples/FasterRCNN/convert_d2) +to run a standard detectron2 model in TensorFlow. diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/notes/contributing.md b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/notes/contributing.md new file mode 100644 index 0000000000000000000000000000000000000000..05173334dee363c59fa728db978dcc2daae8d6c3 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/notes/contributing.md @@ -0,0 +1,49 @@ +# Contributing to detectron2 + +## Issues +We use GitHub issues to track public bugs and questions. +Please make sure to follow one of the +[issue templates](https://github.com/facebookresearch/detectron2/issues/new/choose) +when reporting any issues. + +Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe +disclosure of security bugs. In those cases, please go through the process +outlined on that page and do not file a public issue. + +## Pull Requests +We actively welcome your pull requests. + +However, if you're adding any significant features (e.g. > 50 lines), please +make sure to have a corresponding issue to discuss your motivation and proposals, +before sending a PR. We do not always accept new features, and we take the following +factors into consideration: + +1. Whether the same feature can be achieved without modifying detectron2. +Detectron2 is designed so that you can implement many extensions from the outside, e.g. +those in [projects](https://github.com/facebookresearch/detectron2/tree/master/projects). +If some part is not as extensible, you can also bring up the issue to make it more extensible. +2. Whether the feature is potentially useful to a large audience, or only to a small portion of users. +3. Whether the proposed solution has a good design / interface. +4. Whether the proposed solution adds extra mental/practical overhead to users who don't + need such feature. +5. Whether the proposed solution breaks existing APIs. + +When sending a PR, please do: + +1. If a PR contains multiple orthogonal changes, split it to several PRs. +2. If you've added code that should be tested, add tests. +3. For PRs that need experiments (e.g. adding a new model or new methods), + you don't need to update model zoo, but do provide experiment results in the description of the PR. +4. If APIs are changed, update the documentation. +5. Make sure your code lints with `./dev/linter.sh`. + + +## Contributor License Agreement ("CLA") +In order to accept your pull request, we need you to submit a CLA. You only need +to do this once to work on any of Facebook's open source projects. + +Complete your CLA here: + +## License +By contributing to detectron2, you agree that your contributions will be licensed +under the LICENSE file in the root directory of this source tree. diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/notes/index.rst b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/notes/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..09270ab204b2606445da38ceb268345f613c1a8e --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/notes/index.rst @@ -0,0 +1,10 @@ +Notes +====================================== + +.. toctree:: + :maxdepth: 2 + + benchmarks + compatibility + contributing + changelog diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/README.md b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/README.md new file mode 100644 index 0000000000000000000000000000000000000000..781fccdd813aa5ce1e614a2c75d4908a501e208f --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/README.md @@ -0,0 +1,4 @@ +# Read the docs: + +The latest documentation built from this directory is available at [detectron2.readthedocs.io](https://detectron2.readthedocs.io/). +Documents in this directory are not meant to be read on github. diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/builtin_datasets.md b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/builtin_datasets.md new file mode 100644 index 0000000000000000000000000000000000000000..fc154e5d68e0fb6d62317fe470cfcbc2badd918a --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/builtin_datasets.md @@ -0,0 +1,99 @@ +# Setup Builtin Datasets + +Detectron2 has builtin support for a few datasets. +The datasets are assumed to exist in a directory specified by the environment variable +`DETECTRON2_DATASETS`. +Under this directory, detectron2 expects to find datasets in the structure described below. + +You can set the location for builtin datasets by `export DETECTRON2_DATASETS=/path/to/datasets`. +If left unset, the default is `./datasets` relative to your current working directory. + +The [model zoo](https://github.com/facebookresearch/detectron2/blob/master/MODEL_ZOO.md) +contains configs and models that use these builtin datasets. + +## Expected dataset structure for COCO instance/keypoint detection: + +``` +coco/ + annotations/ + instances_{train,val}2017.json + person_keypoints_{train,val}2017.json + {train,val}2017/ + # image files that are mentioned in the corresponding json +``` + +You can use the 2014 version of the dataset as well. + +Some of the builtin tests (`dev/run_*_tests.sh`) uses a tiny version of the COCO dataset, +which you can download with `./prepare_for_tests.sh`. + +## Expected dataset structure for PanopticFPN: + +``` +coco/ + annotations/ + panoptic_{train,val}2017.json + panoptic_{train,val}2017/ # png annotations + panoptic_stuff_{train,val}2017/ # generated by the script mentioned below +``` + +Install panopticapi by: +``` +pip install git+https://github.com/cocodataset/panopticapi.git +``` +Then, run `python prepare_panoptic_fpn.py`, to extract semantic annotations from panoptic annotations. + +## Expected dataset structure for LVIS instance segmentation: +``` +coco/ + {train,val,test}2017/ +lvis/ + lvis_v0.5_{train,val}.json + lvis_v0.5_image_info_test.json +``` + +Install lvis-api by: +``` +pip install git+https://github.com/lvis-dataset/lvis-api.git +``` + +Run `python prepare_cocofied_lvis.py` to prepare "cocofied" LVIS annotations for evaluation of models trained on the COCO dataset. + +## Expected dataset structure for cityscapes: +``` +cityscapes/ + gtFine/ + train/ + aachen/ + color.png, instanceIds.png, labelIds.png, polygons.json, + labelTrainIds.png + ... + val/ + test/ + leftImg8bit/ + train/ + val/ + test/ +``` +Install cityscapes scripts by: +``` +pip install git+https://github.com/mcordts/cityscapesScripts.git +``` + +Note: labelTrainIds.png are created using cityscapesescript with: +``` +CITYSCAPES_DATASET=$DETECTRON2_DATASETS/cityscapes python cityscapesscripts/preparation/createTrainIdLabelImgs.py +``` +They are not needed for instance segmentation. + +## Expected dataset structure for Pascal VOC: +``` +VOC20{07,12}/ + Annotations/ + ImageSets/ + Main/ + trainval.txt + test.txt + # train.txt or val.txt, if you use these splits + JPEGImages/ +``` diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/configs.md b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/configs.md new file mode 100644 index 0000000000000000000000000000000000000000..9fdb1d596d5992f241e9f8b64f7da9cf666b3166 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/configs.md @@ -0,0 +1,58 @@ +# Configs + +Detectron2 provides a key-value based config system that can be +used to obtain standard, common behaviors. + +Detectron2's config system uses YAML and [yacs](https://github.com/rbgirshick/yacs). +In addition to the [basic operations](../modules/config.html#detectron2.config.CfgNode) +that access and update a config, we provide the following extra functionalities: + +1. The config can have `_BASE_: base.yaml` field, which will load a base config first. + Values in the base config will be overwritten in sub-configs, if there are any conflicts. + We provided several base configs for standard model architectures. +2. We provide config versioning, for backward compatibility. + If your config file is versioned with a config line like `VERSION: 2`, + detectron2 will still recognize it even if we change some keys in the future. + +"Config" is a very limited abstraction. +We do not expect all features in detectron2 to be available through configs. +If you need something that's not available in the config space, +please write code using detectron2's API. + +### Basic Usage + +Some basic usage of the `CfgNode` object is shown here. See more in [documentation](../modules/config.html#detectron2.config.CfgNode). +```python +from detectron2.config import get_cfg +cfg = get_cfg() # obtain detectron2's default config +cfg.xxx = yyy # add new configs for your own custom components +cfg.merge_from_file("my_cfg.yaml") # load values from a file + +cfg.merge_from_list(["MODEL.WEIGHTS", "weights.pth"]) # can also load values from a list of str +print(cfg.dump()) # print formatted configs +``` + +Many builtin tools in detectron2 accepts command line config overwrite: +Key-value pairs provided in the command line will overwrite the existing values in the config file. +For example, [demo.py](../../demo/demo.py) can be used with +``` +./demo.py --config-file config.yaml [--other-options] \ + --opts MODEL.WEIGHTS /path/to/weights INPUT.MIN_SIZE_TEST 1000 +``` + +To see a list of available configs in detectron2 and what they mean, +check [Config References](../modules/config.html#config-references) + + +### Best Practice with Configs + +1. Treat the configs you write as "code": avoid copying them or duplicating them; use `_BASE_` + to share common parts between configs. + +2. Keep the configs you write simple: don't include keys that do not affect the experimental setting. + +3. Keep a version number in your configs (or the base config), e.g., `VERSION: 2`, + for backward compatibility. + We print a warning when reading a config without version number. + The official configs do not include version number because they are meant to + be always up-to-date. diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/data_loading.md b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/data_loading.md new file mode 100644 index 0000000000000000000000000000000000000000..29a30e5af0a0ef290a5e10b327659d31c9ce0a66 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/data_loading.md @@ -0,0 +1,77 @@ + +# Use Custom Dataloaders + +## How the Existing Dataloader Works + +Detectron2 contains a builtin data loading pipeline. +It's good to understand how it works, in case you need to write a custom one. + +Detectron2 provides two functions +[build_detection_{train,test}_loader](../modules/data.html#detectron2.data.build_detection_train_loader) +that create a default data loader from a given config. +Here is how `build_detection_{train,test}_loader` work: + +1. It takes the name of a registered dataset (e.g., "coco_2017_train") and loads a `list[dict]` representing the dataset items + in a lightweight, canonical format. These dataset items are not yet ready to be used by the model (e.g., images are + not loaded into memory, random augmentations have not been applied, etc.). + Details about the dataset format and dataset registration can be found in + [datasets](./datasets.md). +2. Each dict in this list is mapped by a function ("mapper"): + * Users can customize this mapping function by specifying the "mapper" argument in + `build_detection_{train,test}_loader`. The default mapper is [DatasetMapper](../modules/data.html#detectron2.data.DatasetMapper). + * The output format of such function can be arbitrary, as long as it is accepted by the consumer of this data loader (usually the model). + The outputs of the default mapper, after batching, follow the default model input format documented in + [Use Models](./models.html#model-input-format). + * The role of the mapper is to transform the lightweight, canonical representation of a dataset item into a format + that is ready for the model to consume (including, e.g., read images, perform random data augmentation and convert to torch Tensors). + If you would like to perform custom transformations to data, you often want a custom mapper. +3. The outputs of the mapper are batched (simply into a list). +4. This batched data is the output of the data loader. Typically, it's also the input of + `model.forward()`. + + +## Write a Custom Dataloader + +Using a different "mapper" with `build_detection_{train,test}_loader(mapper=)` works for most use cases +of custom data loading. +For example, if you want to resize all images to a fixed size for Mask R-CNN training, write this: + +```python +from detectron2.data import build_detection_train_loader +from detectron2.data import transforms as T +from detectron2.data import detection_utils as utils + +def mapper(dataset_dict): + # Implement a mapper, similar to the default DatasetMapper, but with your own customizations + dataset_dict = copy.deepcopy(dataset_dict) # it will be modified by code below + image = utils.read_image(dataset_dict["file_name"], format="BGR") + image, transforms = T.apply_transform_gens([T.Resize((800, 800))], image) + dataset_dict["image"] = torch.as_tensor(image.transpose(2, 0, 1).astype("float32")) + + annos = [ + utils.transform_instance_annotations(obj, transforms, image.shape[:2]) + for obj in dataset_dict.pop("annotations") + if obj.get("iscrowd", 0) == 0 + ] + instances = utils.annotations_to_instances(annos, image.shape[:2]) + dataset_dict["instances"] = utils.filter_empty_instances(instances) + return dataset_dict + +data_loader = build_detection_train_loader(cfg, mapper=mapper) +# use this dataloader instead of the default +``` +Refer to [API documentation of detectron2.data](../modules/data) for details. + +If you want to change not only the mapper (e.g., to write different sampling or batching logic), +you can write your own data loader. The data loader is simply a +python iterator that produces [the format](./models.md) your model accepts. +You can implement it using any tools you like. + +## Use a Custom Dataloader + +If you use [DefaultTrainer](../modules/engine.html#detectron2.engine.defaults.DefaultTrainer), +you can overwrite its `build_{train,test}_loader` method to use your own dataloader. +See the [densepose dataloader](../../projects/DensePose/train_net.py) +for an example. + +If you write your own training loop, you can plug in your data loader easily. diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/datasets.md b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/datasets.md new file mode 100644 index 0000000000000000000000000000000000000000..e5203eb7ac52d3bfc45dba9343283d37609c8fa7 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/datasets.md @@ -0,0 +1,221 @@ +# Use Custom Datasets + +Datasets that have builtin support in detectron2 are listed in [datasets](../../datasets). +If you want to use a custom dataset while also reusing detectron2's data loaders, +you will need to + +1. __Register__ your dataset (i.e., tell detectron2 how to obtain your dataset). +2. Optionally, __register metadata__ for your dataset. + +Next, we explain the above two concepts in detail. + +The [Colab tutorial](https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5) +has a live example of how to register and train on a dataset of custom formats. + +### Register a Dataset + +To let detectron2 know how to obtain a dataset named "my_dataset", you will implement +a function that returns the items in your dataset and then tell detectron2 about this +function: +```python +def my_dataset_function(): + ... + return list[dict] in the following format + +from detectron2.data import DatasetCatalog +DatasetCatalog.register("my_dataset", my_dataset_function) +``` + +Here, the snippet associates a dataset "my_dataset" with a function that returns the data. +The registration stays effective until the process exists. + +The function can processes data from its original format into either one of the following: +1. Detectron2's standard dataset dict, described below. This will work with many other builtin + features in detectron2, so it's recommended to use it when it's sufficient for your task. +2. Your custom dataset dict. You can also return arbitrary dicts in your own format, + such as adding extra keys for new tasks. + Then you will need to handle them properly downstream as well. + See below for more details. + +#### Standard Dataset Dicts + +For standard tasks +(instance detection, instance/semantic/panoptic segmentation, keypoint detection), +we load the original dataset into `list[dict]` with a specification similar to COCO's json annotations. +This is our standard representation for a dataset. + +Each dict contains information about one image. +The dict may have the following fields, +and the required fields vary based on what the dataloader or the task needs (see more below). + ++ `file_name`: the full path to the image file. Will apply rotation and flipping if the image has such exif information. ++ `height`, `width`: integer. The shape of image. ++ `image_id` (str or int): a unique id that identifies this image. Used + during evaluation to identify the images, but a dataset may use it for different purposes. ++ `annotations` (list[dict]): each dict corresponds to annotations of one instance + in this image. Required by instance detection/segmentation or keypoint detection tasks. + + Images with empty `annotations` will by default be removed from training, + but can be included using `DATALOADER.FILTER_EMPTY_ANNOTATIONS`. + + Each dict contains the following keys, of which `bbox`,`bbox_mode` and `category_id` are required: + + `bbox` (list[float]): list of 4 numbers representing the bounding box of the instance. + + `bbox_mode` (int): the format of bbox. + It must be a member of + [structures.BoxMode](../modules/structures.html#detectron2.structures.BoxMode). + Currently supports: `BoxMode.XYXY_ABS`, `BoxMode.XYWH_ABS`. + + `category_id` (int): an integer in the range [0, num_categories) representing the category label. + The value num_categories is reserved to represent the "background" category, if applicable. + + `segmentation` (list[list[float]] or dict): the segmentation mask of the instance. + + If `list[list[float]]`, it represents a list of polygons, one for each connected component + of the object. Each `list[float]` is one simple polygon in the format of `[x1, y1, ..., xn, yn]`. + The Xs and Ys are either relative coordinates in [0, 1], or absolute coordinates, + depend on whether "bbox_mode" is relative. + + If `dict`, it represents the per-pixel segmentation mask in COCO's RLE format. The dict should have + keys "size" and "counts". You can convert a uint8 segmentation mask of 0s and 1s into + RLE format by `pycocotools.mask.encode(np.asarray(mask, order="F"))`. + + `keypoints` (list[float]): in the format of [x1, y1, v1,..., xn, yn, vn]. + v[i] means the [visibility](http://cocodataset.org/#format-data) of this keypoint. + `n` must be equal to the number of keypoint categories. + The Xs and Ys are either relative coordinates in [0, 1], or absolute coordinates, + depend on whether "bbox_mode" is relative. + + Note that the coordinate annotations in COCO format are integers in range [0, H-1 or W-1]. + By default, detectron2 adds 0.5 to absolute keypoint coordinates to convert them from discrete + pixel indices to floating point coordinates. + + `iscrowd`: 0 (default) or 1. Whether this instance is labeled as COCO's "crowd + region". Don't include this field if you don't know what it means. ++ `sem_seg_file_name`: the full path to the ground truth semantic segmentation file. + Required by semantic segmentation task. + It should be an image whose pixel values are integer labels. + + +Fast R-CNN (with precomputed proposals) is rarely used today. +To train a Fast R-CNN, the following extra keys are needed: + ++ `proposal_boxes` (array): 2D numpy array with shape (K, 4) representing K precomputed proposal boxes for this image. ++ `proposal_objectness_logits` (array): numpy array with shape (K, ), which corresponds to the objectness + logits of proposals in 'proposal_boxes'. ++ `proposal_bbox_mode` (int): the format of the precomputed proposal bbox. + It must be a member of + [structures.BoxMode](../modules/structures.html#detectron2.structures.BoxMode). + Default is `BoxMode.XYXY_ABS`. + +#### Custom Dataset Dicts for New Tasks + +In the `list[dict]` that your dataset function returns, the dictionary can also have arbitrary custom data. +This will be useful for a new task that needs extra information not supported +by the standard dataset dicts. In this case, you need to make sure the downstream code can handle your data +correctly. Usually this requires writing a new `mapper` for the dataloader (see [Use Custom Dataloaders](./data_loading.md)). + +When designing a custom format, note that all dicts are stored in memory +(sometimes serialized and with multiple copies). +To save memory, each dict is meant to contain small but sufficient information +about each sample, such as file names and annotations. +Loading full samples typically happens in the data loader. + +For attributes shared among the entire dataset, use `Metadata` (see below). +To avoid extra memory, do not save such information repeatly for each sample. + +### "Metadata" for Datasets + +Each dataset is associated with some metadata, accessible through +`MetadataCatalog.get(dataset_name).some_metadata`. +Metadata is a key-value mapping that contains information that's shared among +the entire dataset, and usually is used to interpret what's in the dataset, e.g., +names of classes, colors of classes, root of files, etc. +This information will be useful for augmentation, evaluation, visualization, logging, etc. +The structure of metadata depends on the what is needed from the corresponding downstream code. + +If you register a new dataset through `DatasetCatalog.register`, +you may also want to add its corresponding metadata through +`MetadataCatalog.get(dataset_name).some_key = some_value`, to enable any features that need the metadata. +You can do it like this (using the metadata key "thing_classes" as an example): + +```python +from detectron2.data import MetadataCatalog +MetadataCatalog.get("my_dataset").thing_classes = ["person", "dog"] +``` + +Here is a list of metadata keys that are used by builtin features in detectron2. +If you add your own dataset without these metadata, some features may be +unavailable to you: + +* `thing_classes` (list[str]): Used by all instance detection/segmentation tasks. + A list of names for each instance/thing category. + If you load a COCO format dataset, it will be automatically set by the function `load_coco_json`. + +* `thing_colors` (list[tuple(r, g, b)]): Pre-defined color (in [0, 255]) for each thing category. + Used for visualization. If not given, random colors are used. + +* `stuff_classes` (list[str]): Used by semantic and panoptic segmentation tasks. + A list of names for each stuff category. + +* `stuff_colors` (list[tuple(r, g, b)]): Pre-defined color (in [0, 255]) for each stuff category. + Used for visualization. If not given, random colors are used. + +* `keypoint_names` (list[str]): Used by keypoint localization. A list of names for each keypoint. + +* `keypoint_flip_map` (list[tuple[str]]): Used by the keypoint localization task. A list of pairs of names, + where each pair are the two keypoints that should be flipped if the image is + flipped horizontally during augmentation. +* `keypoint_connection_rules`: list[tuple(str, str, (r, g, b))]. Each tuple specifies a pair of keypoints + that are connected and the color to use for the line between them when visualized. + +Some additional metadata that are specific to the evaluation of certain datasets (e.g. COCO): + +* `thing_dataset_id_to_contiguous_id` (dict[int->int]): Used by all instance detection/segmentation tasks in the COCO format. + A mapping from instance class ids in the dataset to contiguous ids in range [0, #class). + Will be automatically set by the function `load_coco_json`. + +* `stuff_dataset_id_to_contiguous_id` (dict[int->int]): Used when generating prediction json files for + semantic/panoptic segmentation. + A mapping from semantic segmentation class ids in the dataset + to contiguous ids in [0, num_categories). It is useful for evaluation only. + +* `json_file`: The COCO annotation json file. Used by COCO evaluation for COCO-format datasets. +* `panoptic_root`, `panoptic_json`: Used by panoptic evaluation. +* `evaluator_type`: Used by the builtin main training script to select + evaluator. Don't use it in a new training script. + You can just provide the [DatasetEvaluator](../modules/evaluation.html#detectron2.evaluation.DatasetEvaluator) + for your dataset directly in your main script. + +NOTE: For background on the concept of "thing" and "stuff", see +[On Seeing Stuff: The Perception of Materials by Humans and Machines](http://persci.mit.edu/pub_pdfs/adelson_spie_01.pdf). +In detectron2, the term "thing" is used for instance-level tasks, +and "stuff" is used for semantic segmentation tasks. +Both are used in panoptic segmentation. + +### Register a COCO Format Dataset + +If your dataset is already a json file in the COCO format, +the dataset and its associated metadata can be registered easily with: +```python +from detectron2.data.datasets import register_coco_instances +register_coco_instances("my_dataset", {}, "json_annotation.json", "path/to/image/dir") +``` + +If your dataset is in COCO format but with extra custom per-instance annotations, +the [load_coco_json](../modules/data.html#detectron2.data.datasets.load_coco_json) +function might be useful. + +### Update the Config for New Datasets + +Once you've registered the dataset, you can use the name of the dataset (e.g., "my_dataset" in +example above) in `cfg.DATASETS.{TRAIN,TEST}`. +There are other configs you might want to change to train or evaluate on new datasets: + +* `MODEL.ROI_HEADS.NUM_CLASSES` and `MODEL.RETINANET.NUM_CLASSES` are the number of thing classes + for R-CNN and RetinaNet models, respectively. +* `MODEL.ROI_KEYPOINT_HEAD.NUM_KEYPOINTS` sets the number of keypoints for Keypoint R-CNN. + You'll also need to set [Keypoint OKS](http://cocodataset.org/#keypoints-eval) + with `TEST.KEYPOINT_OKS_SIGMAS` for evaluation. +* `MODEL.SEM_SEG_HEAD.NUM_CLASSES` sets the number of stuff classes for Semantic FPN & Panoptic FPN. +* If you're training Fast R-CNN (with precomputed proposals), `DATASETS.PROPOSAL_FILES_{TRAIN,TEST}` + need to match the datasets. The format of proposal files are documented + [here](../modules/data.html#detectron2.data.load_proposals_into_dataset). + +New models +(e.g. [TensorMask](../../projects/TensorMask), +[PointRend](../../projects/PointRend)) +often have similar configs of their own that need to be changed as well. diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/deployment.md b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/deployment.md new file mode 100644 index 0000000000000000000000000000000000000000..ad06f7f0da8c47b151c372814160f2c279b1b47f --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/deployment.md @@ -0,0 +1,92 @@ +# Deployment + +## Caffe2 Deployment +We currently support converting a detectron2 model to Caffe2 format through ONNX. +The converted Caffe2 model is able to run without detectron2 dependency in either Python or C++. +It has a runtime optimized for CPU & mobile inference, but not for GPU inference. + +Caffe2 conversion requires PyTorch ≥ 1.4 and ONNX ≥ 1.6. + +### Coverage + +It supports 3 most common meta architectures: `GeneralizedRCNN`, `RetinaNet`, `PanopticFPN`, +and most official models under these 3 meta architectures. + +Users' custom extensions under these architectures (added through registration) are supported +as long as they do not contain control flow or operators not available in Caffe2 (e.g. deformable convolution). +For example, custom backbones and heads are often supported out of the box. + +### Usage + +The conversion APIs are documented at [the API documentation](../modules/export). +We provide a tool, `caffe2_converter.py` as an example that uses +these APIs to convert a standard model. + +To convert an official Mask R-CNN trained on COCO, first +[prepare the COCO dataset](../../datasets/), then pick the model from [Model Zoo](../../MODEL_ZOO.md), and run: +``` +cd tools/deploy/ && ./caffe2_converter.py --config-file ../../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml \ + --output ./caffe2_model --run-eval \ + MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl \ + MODEL.DEVICE cpu +``` + +Note that: +1. The conversion needs valid sample inputs & weights to trace the model. That's why the script requires the dataset. + You can modify the script to obtain sample inputs in other ways. +2. With the `--run-eval` flag, it will evaluate the converted models to verify its accuracy. + The accuracy is typically slightly different (within 0.1 AP) from PyTorch due to + numerical precisions between different implementations. + It's recommended to always verify the accuracy in case your custom model is not supported by the + conversion. + +The converted model is available at the specified `caffe2_model/` directory. Two files `model.pb` +and `model_init.pb` that contain network structure and network parameters are necessary for deployment. +These files can then be loaded in C++ or Python using Caffe2's APIs. + +The script generates `model.svg` file which contains a visualization of the network. +You can also load `model.pb` to tools such as [netron](https://github.com/lutzroeder/netron) to visualize it. + +### Use the model in C++/Python + +The model can be loaded in C++. An example [caffe2_mask_rcnn.cpp](../../tools/deploy/) is given, +which performs CPU/GPU inference using `COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x`. + +The C++ example needs to be built with: +* PyTorch with caffe2 inside +* gflags, glog, opencv +* protobuf headers that match the version of your caffe2 +* MKL headers if caffe2 is built with MKL + +The following can compile the example inside [official detectron2 docker](../../docker/): +``` +sudo apt update && sudo apt install libgflags-dev libgoogle-glog-dev libopencv-dev +pip install mkl-include +wget https://github.com/protocolbuffers/protobuf/releases/download/v3.6.1/protobuf-cpp-3.6.1.tar.gz +tar xf protobuf-cpp-3.6.1.tar.gz +export CPATH=$(readlink -f ./protobuf-3.6.1/src/):$HOME/.local/include +export CMAKE_PREFIX_PATH=$HOME/.local/lib/python3.6/site-packages/torch/ +mkdir build && cd build +cmake -DTORCH_CUDA_ARCH_LIST=$TORCH_CUDA_ARCH_LIST .. && make + +# To run: +./caffe2_mask_rcnn --predict_net=./model.pb --init_net=./model_init.pb --input=input.jpg +``` + +Note that: + +* All converted models (the .pb files) take two input tensors: + "data" is an NCHW image, and "im_info" is an Nx3 tensor consisting of (height, width, 1.0) for + each image (the shape of "data" might be larger than that in "im_info" due to padding). + +* The converted models do not contain post-processing operations that + transform raw layer outputs into formatted predictions. + The example only produces raw outputs (28x28 masks) from the final + layers that are not post-processed, because in actual deployment, an application often needs + its custom lightweight post-processing (e.g. full-image masks for every detected object is often not necessary). + +We also provide a python wrapper around the converted model, in the +[Caffe2Model.\_\_call\_\_](../modules/export.html#detectron2.export.Caffe2Model.__call__) method. +This method has an interface that's identical to the [pytorch versions of models](./models.md), +and it internally applies pre/post-processing code to match the formats. +They can serve as a reference for pre/post-processing in actual deployment. diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/evaluation.md b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/evaluation.md new file mode 100644 index 0000000000000000000000000000000000000000..c1013206551370e2ed42ceb59892d0fccfb7b749 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/evaluation.md @@ -0,0 +1,43 @@ + +# Evaluation + +Evaluation is a process that takes a number of inputs/outputs pairs and aggregate them. +You can always [use the model](./models.md) directly and just parse its inputs/outputs manually to perform +evaluation. +Alternatively, evaluation is implemented in detectron2 using the [DatasetEvaluator](../modules/evaluation.html#detectron2.evaluation.DatasetEvaluator) +interface. + +Detectron2 includes a few `DatasetEvaluator` that computes metrics using standard dataset-specific +APIs (e.g., COCO, LVIS). +You can also implement your own `DatasetEvaluator` that performs some other jobs +using the inputs/outputs pairs. +For example, to count how many instances are detected on the validation set: + +``` +class Counter(DatasetEvaluator): + def reset(self): + self.count = 0 + def process(self, inputs, outputs): + for output in outputs: + self.count += len(output["instances"]) + def evaluate(self): + # save self.count somewhere, or print it, or return it. + return {"count": self.count} +``` + +Once you have some `DatasetEvaluator`, you can run it with +[inference_on_dataset](../modules/evaluation.html#detectron2.evaluation.inference_on_dataset). +For example, + +```python +val_results = inference_on_dataset( + model, + val_data_loader, + DatasetEvaluators([COCOEvaluator(...), Counter()])) +``` +Compared to running the evaluation manually using the model, the benefit of this function is that +you can merge evaluators together using [DatasetEvaluators](../modules/evaluation.html#detectron2.evaluation.DatasetEvaluators). +In this way you can run all evaluations without having to go through the dataset multiple times. + +The `inference_on_dataset` function also provides accurate speed benchmarks for the +given model and dataset. diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/extend.md b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/extend.md new file mode 100644 index 0000000000000000000000000000000000000000..15b316dd19685aa8efea97843608a6d3626702cf --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/extend.md @@ -0,0 +1,53 @@ +# Extend Detectron2's Defaults + +__Research is about doing things in new ways__. +This brings a tension in how to create abstractions in code, +which is a challenge for any research engineering project of a significant size: + +1. On one hand, it needs to have very thin abstractions to allow for the possibility of doing + everything in new ways. It should be reasonably easy to break existing + abstractions and replace them with new ones. + +2. On the other hand, such a project also needs reasonably high-level + abstractions, so that users can easily do things in standard ways, + without worrying too much about the details that only certain researchers care about. + +In detectron2, there are two types of interfaces that address this tension together: + +1. Functions and classes that take a config (`cfg`) argument + (sometimes with only a few extra arguments). + + Such functions and classes implement + the "standard default" behavior: it will read what it needs from the + config and do the "standard" thing. + Users only need to load a given config and pass it around, without having to worry about + which arguments are used and what they all mean. + +2. Functions and classes that have well-defined explicit arguments. + + Each of these is a small building block of the entire system. + They require users' expertise to understand what each argument should be, + and require more effort to stitch together to a larger system. + But they can be stitched together in more flexible ways. + + When you need to implement something not supported by the "standard defaults" + included in detectron2, these well-defined components can be reused. + +3. (experimental) A few classes are implemented with the + [@configurable](../../modules/config.html#detectron2.config.configurable) + decorator - they can be called with either a config, or with explicit arguments. + Their explicit argument interfaces are currently __experimental__ and subject to change. + + +If you only need the standard behavior, the [Beginner's Tutorial](./getting_started.md) +should suffice. If you need to extend detectron2 to your own needs, +see the following tutorials for more details: + +* Detectron2 includes a few standard datasets. To use custom ones, see + [Use Custom Datasets](./datasets.md). +* Detectron2 contains the standard logic that creates a data loader for training/testing from a + dataset, but you can write your own as well. See [Use Custom Data Loaders](./data_loading.md). +* Detectron2 implements many standard detection models, and provide ways for you + to overwrite their behaviors. See [Use Models](./models.md) and [Write Models](./write-models.md). +* Detectron2 provides a default training loop that is good for common training tasks. + You can customize it with hooks, or write your own loop instead. See [training](./training.md). diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/getting_started.md b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/getting_started.md new file mode 100644 index 0000000000000000000000000000000000000000..95366519448df79ae09122adbca52c458f9b5013 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/getting_started.md @@ -0,0 +1,79 @@ +## Getting Started with Detectron2 + +This document provides a brief intro of the usage of builtin command-line tools in detectron2. + +For a tutorial that involves actual coding with the API, +see our [Colab Notebook](https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5) +which covers how to run inference with an +existing model, and how to train a builtin model on a custom dataset. + +For more advanced tutorials, refer to our [documentation](https://detectron2.readthedocs.io/tutorials/extend.html). + + +### Inference Demo with Pre-trained Models + +1. Pick a model and its config file from + [model zoo](MODEL_ZOO.md), + for example, `mask_rcnn_R_50_FPN_3x.yaml`. +2. We provide `demo.py` that is able to run builtin standard models. Run it with: +``` +cd demo/ +python demo.py --config-file ../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml \ + --input input1.jpg input2.jpg \ + [--other-options] + --opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl +``` +The configs are made for training, therefore we need to specify `MODEL.WEIGHTS` to a model from model zoo for evaluation. +This command will run the inference and show visualizations in an OpenCV window. + +For details of the command line arguments, see `demo.py -h` or look at its source code +to understand its behavior. Some common arguments are: +* To run __on your webcam__, replace `--input files` with `--webcam`. +* To run __on a video__, replace `--input files` with `--video-input video.mp4`. +* To run __on cpu__, add `MODEL.DEVICE cpu` after `--opts`. +* To save outputs to a directory (for images) or a file (for webcam or video), use `--output`. + + +### Training & Evaluation in Command Line + +We provide a script in "tools/{,plain_}train_net.py", that is made to train +all the configs provided in detectron2. +You may want to use it as a reference to write your own training script. + +To train a model with "train_net.py", first +setup the corresponding datasets following +[datasets/README.md](./datasets/README.md), +then run: +``` +cd tools/ +./train_net.py --num-gpus 8 \ + --config-file ../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml +``` + +The configs are made for 8-GPU training. +To train on 1 GPU, you may need to [change some parameters](https://arxiv.org/abs/1706.02677), e.g.: +``` +./train_net.py \ + --config-file ../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml \ + --num-gpus 1 SOLVER.IMS_PER_BATCH 2 SOLVER.BASE_LR 0.0025 +``` + +For most models, CPU training is not supported. + +To evaluate a model's performance, use +``` +./train_net.py \ + --config-file ../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml \ + --eval-only MODEL.WEIGHTS /path/to/checkpoint_file +``` +For more options, see `./train_net.py -h`. + +### Use Detectron2 APIs in Your Code + +See our [Colab Notebook](https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5) +to learn how to use detectron2 APIs to: +1. run inference with an existing model +2. train a builtin model on a custom dataset + +See [detectron2/projects](https://github.com/facebookresearch/detectron2/tree/master/projects) +for more ways to build your project on detectron2. diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/index.rst b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..2eb25e6e154c310d1ccb3ec62aaaff272efecee6 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/index.rst @@ -0,0 +1,18 @@ +Tutorials +====================================== + +.. toctree:: + :maxdepth: 2 + + install + getting_started + builtin_datasets + extend + datasets + data_loading + models + write-models + training + evaluation + configs + deployment diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/install.md b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/install.md new file mode 100644 index 0000000000000000000000000000000000000000..545bf46337610df791de79e7735869e8c57ec251 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/install.md @@ -0,0 +1,184 @@ +## Installation + +Our [Colab Notebook](https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5) +has step-by-step instructions that install detectron2. +The [Dockerfile](docker) +also installs detectron2 with a few simple commands. + +### Requirements +- Linux or macOS with Python ≥ 3.6 +- PyTorch ≥ 1.4 +- [torchvision](https://github.com/pytorch/vision/) that matches the PyTorch installation. + You can install them together at [pytorch.org](https://pytorch.org) to make sure of this. +- OpenCV, optional, needed by demo and visualization +- pycocotools: `pip install cython; pip install -U 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'` + + +### Build Detectron2 from Source + +gcc & g++ ≥ 5 are required. [ninja](https://ninja-build.org/) is recommended for faster build. +After having them, run: +``` +python -m pip install 'git+https://github.com/facebookresearch/detectron2.git' +# (add --user if you don't have permission) + +# Or, to install it from a local clone: +git clone https://github.com/facebookresearch/detectron2.git +python -m pip install -e detectron2 + +# Or if you are on macOS +# CC=clang CXX=clang++ python -m pip install -e . +``` + +To __rebuild__ detectron2 that's built from a local clone, use `rm -rf build/ **/*.so` to clean the +old build first. You often need to rebuild detectron2 after reinstalling PyTorch. + +### Install Pre-Built Detectron2 (Linux only) +``` +# for CUDA 10.1: +python -m pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/index.html +``` +You can replace cu101 with "cu{100,92}" or "cpu". + +Note that: +1. Such installation has to be used with certain version of official PyTorch release. + See [releases](https://github.com/facebookresearch/detectron2/releases) for requirements. + It will not work with a different version of PyTorch or a non-official build of PyTorch. +2. Such installation is out-of-date w.r.t. master branch of detectron2. It may not be + compatible with the master branch of a research project that uses detectron2 (e.g. those in + [projects](projects) or [meshrcnn](https://github.com/facebookresearch/meshrcnn/)). + +### Common Installation Issues + +If you met issues using the pre-built detectron2, please uninstall it and try building it from source. + +Click each issue for its solutions: + +
+ +Undefined torch/aten/caffe2 symbols, or segmentation fault immediately when running the library. + +
+ +This usually happens when detectron2 or torchvision is not +compiled with the version of PyTorch you're running. + +Pre-built torchvision or detectron2 has to work with the corresponding official release of pytorch. +If the error comes from a pre-built torchvision, uninstall torchvision and pytorch and reinstall them +following [pytorch.org](http://pytorch.org). So the versions will match. + +If the error comes from a pre-built detectron2, check [release notes](https://github.com/facebookresearch/detectron2/releases) +to see the corresponding pytorch version required for each pre-built detectron2. + +If the error comes from detectron2 or torchvision that you built manually from source, +remove files you built (`build/`, `**/*.so`) and rebuild it so it can pick up the version of pytorch currently in your environment. + +If you cannot resolve this problem, please include the output of `gdb -ex "r" -ex "bt" -ex "quit" --args python -m detectron2.utils.collect_env` +in your issue. +
+ +
+ +Undefined C++ symbols (e.g. `GLIBCXX`) or C++ symbols not found. + +
+Usually it's because the library is compiled with a newer C++ compiler but run with an old C++ runtime. + +This often happens with old anaconda. +Try `conda update libgcc`. Then rebuild detectron2. + +The fundamental solution is to run the code with proper C++ runtime. +One way is to use `LD_PRELOAD=/path/to/libstdc++.so`. + +
+ +
+ +"Not compiled with GPU support" or "Detectron2 CUDA Compiler: not available". + +
+CUDA is not found when building detectron2. +You should make sure + +``` +python -c 'import torch; from torch.utils.cpp_extension import CUDA_HOME; print(torch.cuda.is_available(), CUDA_HOME)' +``` + +print valid outputs at the time you build detectron2. + +Most models can run inference (but not training) without GPU support. To use CPUs, set `MODEL.DEVICE='cpu'` in the config. +
+ +
+ +"invalid device function" or "no kernel image is available for execution". + +
+Two possibilities: + +* You build detectron2 with one version of CUDA but run it with a different version. + + To check whether it is the case, + use `python -m detectron2.utils.collect_env` to find out inconsistent CUDA versions. + In the output of this command, you should expect "Detectron2 CUDA Compiler", "CUDA_HOME", "PyTorch built with - CUDA" + to contain cuda libraries of the same version. + + When they are inconsistent, + you need to either install a different build of PyTorch (or build by yourself) + to match your local CUDA installation, or install a different version of CUDA to match PyTorch. + +* Detectron2 or PyTorch/torchvision is not built for the correct GPU architecture (compute compatibility). + + The GPU architecture for PyTorch/detectron2/torchvision is available in the "architecture flags" in + `python -m detectron2.utils.collect_env`. + + The GPU architecture flags of detectron2/torchvision by default matches the GPU model detected + during compilation. This means the compiled code may not work on a different GPU model. + To overwrite the GPU architecture for detectron2/torchvision, use `TORCH_CUDA_ARCH_LIST` environment variable during compilation. + + For example, `export TORCH_CUDA_ARCH_LIST=6.0,7.0` makes it compile for both P100s and V100s. + Visit [developer.nvidia.com/cuda-gpus](https://developer.nvidia.com/cuda-gpus) to find out + the correct compute compatibility number for your device. + +
+ +
+ +Undefined CUDA symbols; cannot open libcudart.so; other nvcc failures. + +
+The version of NVCC you use to build detectron2 or torchvision does +not match the version of CUDA you are running with. +This often happens when using anaconda's CUDA runtime. + +Use `python -m detectron2.utils.collect_env` to find out inconsistent CUDA versions. +In the output of this command, you should expect "Detectron2 CUDA Compiler", "CUDA_HOME", "PyTorch built with - CUDA" +to contain cuda libraries of the same version. + +When they are inconsistent, +you need to either install a different build of PyTorch (or build by yourself) +to match your local CUDA installation, or install a different version of CUDA to match PyTorch. +
+ + +
+ +"ImportError: cannot import name '_C'". + +
+Please build and install detectron2 following the instructions above. + +If you are running code from detectron2's root directory, `cd` to a different one. +Otherwise you may not import the code that you installed. +
+ +
+ +ONNX conversion segfault after some "TraceWarning". + +
+The ONNX package is compiled with too old compiler. + +Please build and install ONNX from its source code using a compiler +whose version is closer to what's used by PyTorch (available in `torch.__config__.show()`). +
diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/models.md b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/models.md new file mode 100644 index 0000000000000000000000000000000000000000..c0b731d24f3cb1f403cd2938633fa10c3bd95afd --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/models.md @@ -0,0 +1,151 @@ +# Use Models + +Models (and their sub-models) in detectron2 are built by +functions such as `build_model`, `build_backbone`, `build_roi_heads`: +```python +from detectron2.modeling import build_model +model = build_model(cfg) # returns a torch.nn.Module +``` + +`build_model` only builds the model structure, and fill it with random parameters. +See below for how to load an existing checkpoint to the model, +and how to use the `model` object. + +### Load/Save a Checkpoint +```python +from detectron2.checkpoint import DetectionCheckpointer +DetectionCheckpointer(model).load(file_path) # load a file to model + +checkpointer = DetectionCheckpointer(model, save_dir="output") +checkpointer.save("model_999") # save to output/model_999.pth +``` + +Detectron2's checkpointer recognizes models in pytorch's `.pth` format, as well as the `.pkl` files +in our model zoo. +See [API doc](../modules/checkpoint.html#detectron2.checkpoint.DetectionCheckpointer) +for more details about its usage. + +The model files can be arbitrarily manipulated using `torch.{load,save}` for `.pth` files or +`pickle.{dump,load}` for `.pkl` files. + +### Use a Model + +A model can be called by `outputs = model(inputs)`, where `inputs` is a `list[dict]`. +Each dict corresponds to one image and the required keys +depend on the type of model, and whether the model is in training or evaluation mode. +For example, in order to do inference, +all existing models expect the "image" key, and optionally "height" and "width". +The detailed format of inputs and outputs of existing models are explained below. + +When in training mode, all models are required to be used under an `EventStorage`. +The training statistics will be put into the storage: +```python +from detectron2.utils.events import EventStorage +with EventStorage() as storage: + losses = model(inputs) +``` + +If you only want to do simple inference using an existing model, +[DefaultPredictor](../modules/engine.html#detectron2.engine.defaults.DefaultPredictor) +is a wrapper around model that provides such basic functionality. +It includes default behavior including model loading, preprocessing, +and operates on single image rather than batches. + +### Model Input Format + +Users can implement custom models that support any arbitrary input format. +Here we describe the standard input format that all builtin models support in detectron2. +They all take a `list[dict]` as the inputs. Each dict +corresponds to information about one image. + +The dict may contain the following keys: + +* "image": `Tensor` in (C, H, W) format. The meaning of channels are defined by `cfg.INPUT.FORMAT`. + Image normalization, if any, will be performed inside the model using + `cfg.MODEL.PIXEL_{MEAN,STD}`. +* "instances": an [Instances](../modules/structures.html#detectron2.structures.Instances) + object, with the following fields: + + "gt_boxes": a [Boxes](../modules/structures.html#detectron2.structures.Boxes) object storing N boxes, one for each instance. + + "gt_classes": `Tensor` of long type, a vector of N labels, in range [0, num_categories). + + "gt_masks": a [PolygonMasks](../modules/structures.html#detectron2.structures.PolygonMasks) + or [BitMasks](../modules/structures.html#detectron2.structures.BitMasks) object storing N masks, one for each instance. + + "gt_keypoints": a [Keypoints](../modules/structures.html#detectron2.structures.Keypoints) + object storing N keypoint sets, one for each instance. +* "proposals": an [Instances](../modules/structures.html#detectron2.structures.Instances) + object used only in Fast R-CNN style models, with the following fields: + + "proposal_boxes": a [Boxes](../modules/structures.html#detectron2.structures.Boxes) object storing P proposal boxes. + + "objectness_logits": `Tensor`, a vector of P scores, one for each proposal. +* "height", "width": the **desired** output height and width, which is not necessarily the same + as the height or width of the `image` input field. + For example, the `image` input field might be a resized image, + but you may want the outputs to be in **original** resolution. + + If provided, the model will produce output in this resolution, + rather than in the resolution of the `image` as input into the model. This is more efficient and accurate. +* "sem_seg": `Tensor[int]` in (H, W) format. The semantic segmentation ground truth. + Values represent category labels starting from 0. + + +#### How it connects to data loader: + +The output of the default [DatasetMapper]( ../modules/data.html#detectron2.data.DatasetMapper) is a dict +that follows the above format. +After the data loader performs batching, it becomes `list[dict]` which the builtin models support. + + +### Model Output Format + +When in training mode, the builtin models output a `dict[str->ScalarTensor]` with all the losses. + +When in inference mode, the builtin models output a `list[dict]`, one dict for each image. +Based on the tasks the model is doing, each dict may contain the following fields: + +* "instances": [Instances](../modules/structures.html#detectron2.structures.Instances) + object with the following fields: + * "pred_boxes": [Boxes](../modules/structures.html#detectron2.structures.Boxes) object storing N boxes, one for each detected instance. + * "scores": `Tensor`, a vector of N scores. + * "pred_classes": `Tensor`, a vector of N labels in range [0, num_categories). + + "pred_masks": a `Tensor` of shape (N, H, W), masks for each detected instance. + + "pred_keypoints": a `Tensor` of shape (N, num_keypoint, 3). + Each row in the last dimension is (x, y, score). Scores are larger than 0. +* "sem_seg": `Tensor` of (num_categories, H, W), the semantic segmentation prediction. +* "proposals": [Instances](../modules/structures.html#detectron2.structures.Instances) + object with the following fields: + * "proposal_boxes": [Boxes](../modules/structures.html#detectron2.structures.Boxes) + object storing N boxes. + * "objectness_logits": a torch vector of N scores. +* "panoptic_seg": A tuple of `(Tensor, list[dict])`. The tensor has shape (H, W), where each element + represent the segment id of the pixel. Each dict describes one segment id and has the following fields: + * "id": the segment id + * "isthing": whether the segment is a thing or stuff + * "category_id": the category id of this segment. It represents the thing + class id when `isthing==True`, and the stuff class id otherwise. + + +### Partially execute a model: + +Sometimes you may want to obtain an intermediate tensor inside a model. +Since there are typically hundreds of intermediate tensors, there isn't an API that provides you +the intermediate result you need. +You have the following options: + +1. Write a (sub)model. Following the [tutorial](./write-models.md), you can + rewrite a model component (e.g. a head of a model), such that it + does the same thing as the existing component, but returns the output + you need. +2. Partially execute a model. You can create the model as usual, + but use custom code to execute it instead of its `forward()`. For example, + the following code obtains mask features before mask head. + +```python +images = ImageList.from_tensors(...) # preprocessed input tensor +model = build_model(cfg) +features = model.backbone(images.tensor) +proposals, _ = model.proposal_generator(images, features) +instances = model.roi_heads._forward_box(features, proposals) +mask_features = [features[f] for f in model.roi_heads.in_features] +mask_features = model.roi_heads.mask_pooler(mask_features, [x.pred_boxes for x in instances]) +``` + +Note that both options require you to read the existing forward code to understand +how to write code to obtain the outputs you need. diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/training.md b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/training.md new file mode 100644 index 0000000000000000000000000000000000000000..55df16752f012f7a9e25c5ba00e5c39f573b6cab --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/training.md @@ -0,0 +1,50 @@ +# Training + +From the previous tutorials, you may now have a custom model and data loader. + +You are free to create your own optimizer, and write the training logic: it's +usually easy with PyTorch, and allow researchers to see the entire training +logic more clearly and have full control. +One such example is provided in [tools/plain_train_net.py](../../tools/plain_train_net.py). + +We also provide a standarized "trainer" abstraction with a +[minimal hook system](../modules/engine.html#detectron2.engine.HookBase) +that helps simplify the standard types of training. + +You can use +[SimpleTrainer().train()](../modules/engine.html#detectron2.engine.SimpleTrainer) +which provides minimal abstraction for single-cost single-optimizer single-data-source training. +The builtin `train_net.py` script uses +[DefaultTrainer().train()](../modules/engine.html#detectron2.engine.defaults.DefaultTrainer), +which includes more standard default behavior that one might want to opt in, +including default configurations for learning rate schedule, +logging, evaluation, checkpointing etc. +This also means that it's less likely to support some non-standard behavior +you might want during research. + +To customize the training loops, you can: + +1. If your customization is similar to what `DefaultTrainer` is already doing, +you can change behavior of `DefaultTrainer` by overwriting [its methods](../modules/engine.html#detectron2.engine.defaults.DefaultTrainer) +in a subclass, like what [tools/train_net.py](../../tools/train_net.py) does. +2. If you need something very novel, you can start from [tools/plain_train_net.py](../../tools/plain_train_net.py) to implement them yourself. + +### Logging of Metrics + +During training, metrics are saved to a centralized [EventStorage](../modules/utils.html#detectron2.utils.events.EventStorage). +You can use the following code to access it and log metrics to it: +``` +from detectron2.utils.events import get_event_storage + +# inside the model: +if self.training: + value = # compute the value from inputs + storage = get_event_storage() + storage.put_scalar("some_accuracy", value) +``` + +Refer to its documentation for more details. + +Metrics are then saved to various destinations with [EventWriter](../modules/utils.html#module-detectron2.utils.events). +DefaultTrainer enables a few `EventWriter` with default configurations. +See above for how to customize them. diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/write-models.md b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/write-models.md new file mode 100644 index 0000000000000000000000000000000000000000..5611ba75c700a5fa2aa087e053144fc56d1442af --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/docs/tutorials/write-models.md @@ -0,0 +1,39 @@ +# Write Models + +If you are trying to do something completely new, you may wish to implement +a model entirely from scratch within detectron2. However, in many situations you may +be interested in modifying or extending some components of an existing model. +Therefore, we also provide a registration mechanism that lets you override the +behavior of certain internal components of standard models. + +For example, to add a new backbone, import this code in your code: +```python +from detectron2.modeling import BACKBONE_REGISTRY, Backbone, ShapeSpec + +@BACKBONE_REGISTRY.register() +class ToyBackBone(Backbone): + def __init__(self, cfg, input_shape): + # create your own backbone + self.conv1 = nn.Conv2d(3, 64, kernel_size=7, stride=16, padding=3) + + def forward(self, image): + return {"conv1": self.conv1(image)} + + def output_shape(self): + return {"conv1": ShapeSpec(channels=64, stride=16)} +``` +Then, you can use `cfg.MODEL.BACKBONE.NAME = 'ToyBackBone'` in your config object. +`build_model(cfg)` will then call your `ToyBackBone` instead. + +As another example, to add new abilities to the ROI heads in the Generalized R-CNN meta-architecture, +you can implement a new +[ROIHeads](../modules/modeling.html#detectron2.modeling.ROIHeads) subclass and put it in the `ROI_HEADS_REGISTRY`. +See [densepose in detectron2](../../projects/DensePose) +and [meshrcnn](https://github.com/facebookresearch/meshrcnn) +for examples that implement new ROIHeads to perform new tasks. +And [projects/](../../projects/) +contains more examples that implement different architectures. + +A complete list of registries can be found in [API documentation](../modules/modeling.html#model-registries). +You can register components in these registries to customize different parts of a model, or the +entire model. diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/Base-DensePose-RCNN-FPN.yaml b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/Base-DensePose-RCNN-FPN.yaml new file mode 100644 index 0000000000000000000000000000000000000000..576ffa43f26ff862405c2c36578c0e3e5b41a2d1 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/Base-DensePose-RCNN-FPN.yaml @@ -0,0 +1,47 @@ +MODEL: + META_ARCHITECTURE: "GeneralizedRCNN" + BACKBONE: + NAME: "build_resnet_fpn_backbone" + RESNETS: + OUT_FEATURES: ["res2", "res3", "res4", "res5"] + FPN: + IN_FEATURES: ["res2", "res3", "res4", "res5"] + ANCHOR_GENERATOR: + SIZES: [[32], [64], [128], [256], [512]] # One size for each in feature map + ASPECT_RATIOS: [[0.5, 1.0, 2.0]] # Three aspect ratios (same for all in feature maps) + RPN: + IN_FEATURES: ["p2", "p3", "p4", "p5", "p6"] + PRE_NMS_TOPK_TRAIN: 2000 # Per FPN level + PRE_NMS_TOPK_TEST: 1000 # Per FPN level + # Detectron1 uses 2000 proposals per-batch, + # (See "modeling/rpn/rpn_outputs.py" for details of this legacy issue) + # which is approximately 1000 proposals per-image since the default batch size for FPN is 2. + POST_NMS_TOPK_TRAIN: 1000 + POST_NMS_TOPK_TEST: 1000 + + DENSEPOSE_ON: True + ROI_HEADS: + NAME: "DensePoseROIHeads" + IN_FEATURES: ["p2", "p3", "p4", "p5"] + NUM_CLASSES: 1 + ROI_BOX_HEAD: + NAME: "FastRCNNConvFCHead" + NUM_FC: 2 + POOLER_RESOLUTION: 7 + POOLER_SAMPLING_RATIO: 2 + POOLER_TYPE: "ROIAlign" + ROI_DENSEPOSE_HEAD: + NAME: "DensePoseV1ConvXHead" + POOLER_TYPE: "ROIAlign" + NUM_COARSE_SEGM_CHANNELS: 2 +DATASETS: + TRAIN: ("densepose_coco_2014_train", "densepose_coco_2014_valminusminival") + TEST: ("densepose_coco_2014_minival",) +SOLVER: + IMS_PER_BATCH: 16 + BASE_LR: 0.01 + STEPS: (60000, 80000) + MAX_ITER: 90000 + WARMUP_FACTOR: 0.1 +INPUT: + MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800) diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_101_FPN_DL_WC1_s1x.yaml b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_101_FPN_DL_WC1_s1x.yaml new file mode 100644 index 0000000000000000000000000000000000000000..23e048fabf55bec75e616c5c3234dc14a88aae7f --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_101_FPN_DL_WC1_s1x.yaml @@ -0,0 +1,16 @@ +_BASE_: "Base-DensePose-RCNN-FPN.yaml" +MODEL: + WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl" + RESNETS: + DEPTH: 101 + ROI_DENSEPOSE_HEAD: + NAME: "DensePoseDeepLabHead" + UV_CONFIDENCE: + ENABLED: True + TYPE: "iid_iso" + POINT_REGRESSION_WEIGHTS: 0.0005 +SOLVER: + CLIP_GRADIENTS: + ENABLED: True + MAX_ITER: 130000 + STEPS: (100000, 120000) diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_101_FPN_DL_WC2_s1x.yaml b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_101_FPN_DL_WC2_s1x.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3788a4fb3dfee8e12233516362c6491fb680b31a --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_101_FPN_DL_WC2_s1x.yaml @@ -0,0 +1,16 @@ +_BASE_: "Base-DensePose-RCNN-FPN.yaml" +MODEL: + WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl" + RESNETS: + DEPTH: 101 + ROI_DENSEPOSE_HEAD: + NAME: "DensePoseDeepLabHead" + UV_CONFIDENCE: + ENABLED: True + TYPE: "indep_aniso" + POINT_REGRESSION_WEIGHTS: 0.0005 +SOLVER: + CLIP_GRADIENTS: + ENABLED: True + MAX_ITER: 130000 + STEPS: (100000, 120000) diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_101_FPN_DL_s1x.yaml b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_101_FPN_DL_s1x.yaml new file mode 100644 index 0000000000000000000000000000000000000000..17c6e7d498924ca8a43ff05de0bed71b59b39d9b --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_101_FPN_DL_s1x.yaml @@ -0,0 +1,10 @@ +_BASE_: "Base-DensePose-RCNN-FPN.yaml" +MODEL: + WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl" + RESNETS: + DEPTH: 101 + ROI_DENSEPOSE_HEAD: + NAME: "DensePoseDeepLabHead" +SOLVER: + MAX_ITER: 130000 + STEPS: (100000, 120000) diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_101_FPN_WC1_s1x.yaml b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_101_FPN_WC1_s1x.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b91094e445fa7ae11d7efacd8e7d53f04991dd04 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_101_FPN_WC1_s1x.yaml @@ -0,0 +1,16 @@ +_BASE_: "Base-DensePose-RCNN-FPN.yaml" +MODEL: + WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl" + RESNETS: + DEPTH: 101 + ROI_DENSEPOSE_HEAD: + UV_CONFIDENCE: + ENABLED: True + TYPE: "iid_iso" + POINT_REGRESSION_WEIGHTS: 0.0005 +SOLVER: + CLIP_GRADIENTS: + ENABLED: True + MAX_ITER: 130000 + STEPS: (100000, 120000) + WARMUP_FACTOR: 0.025 diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_101_FPN_WC2_s1x.yaml b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_101_FPN_WC2_s1x.yaml new file mode 100644 index 0000000000000000000000000000000000000000..41e14ebaf62de6e8b46c1f8bc87fcdf85daf4dc0 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_101_FPN_WC2_s1x.yaml @@ -0,0 +1,16 @@ +_BASE_: "Base-DensePose-RCNN-FPN.yaml" +MODEL: + WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl" + RESNETS: + DEPTH: 101 + ROI_DENSEPOSE_HEAD: + UV_CONFIDENCE: + ENABLED: True + TYPE: "indep_aniso" + POINT_REGRESSION_WEIGHTS: 0.0005 +SOLVER: + CLIP_GRADIENTS: + ENABLED: True + MAX_ITER: 130000 + STEPS: (100000, 120000) + WARMUP_FACTOR: 0.025 diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_101_FPN_s1x.yaml b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_101_FPN_s1x.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b3a8436aec504b4c14d9f9fff2907f54b722860d --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_101_FPN_s1x.yaml @@ -0,0 +1,8 @@ +_BASE_: "Base-DensePose-RCNN-FPN.yaml" +MODEL: + WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl" + RESNETS: + DEPTH: 101 +SOLVER: + MAX_ITER: 130000 + STEPS: (100000, 120000) diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_101_FPN_s1x_legacy.yaml b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_101_FPN_s1x_legacy.yaml new file mode 100644 index 0000000000000000000000000000000000000000..907e66fba785aa2c6706cc30021e654716a2fdcc --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_101_FPN_s1x_legacy.yaml @@ -0,0 +1,17 @@ +_BASE_: "Base-DensePose-RCNN-FPN.yaml" +MODEL: + WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl" + RESNETS: + DEPTH: 101 + ROI_DENSEPOSE_HEAD: + NUM_COARSE_SEGM_CHANNELS: 15 + POOLER_RESOLUTION: 14 + HEATMAP_SIZE: 56 + INDEX_WEIGHTS: 2.0 + PART_WEIGHTS: 0.3 + POINT_REGRESSION_WEIGHTS: 0.1 + DECODER_ON: False +SOLVER: + BASE_LR: 0.002 + MAX_ITER: 130000 + STEPS: (100000, 120000) diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_DL_WC1_s1x.yaml b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_DL_WC1_s1x.yaml new file mode 100644 index 0000000000000000000000000000000000000000..498c834de22809c35b006adba44e95aece403a92 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_DL_WC1_s1x.yaml @@ -0,0 +1,16 @@ +_BASE_: "Base-DensePose-RCNN-FPN.yaml" +MODEL: + WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" + RESNETS: + DEPTH: 50 + ROI_DENSEPOSE_HEAD: + NAME: "DensePoseDeepLabHead" + UV_CONFIDENCE: + ENABLED: True + TYPE: "iid_iso" + POINT_REGRESSION_WEIGHTS: 0.0005 +SOLVER: + CLIP_GRADIENTS: + ENABLED: True + MAX_ITER: 130000 + STEPS: (100000, 120000) diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_DL_WC2_s1x.yaml b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_DL_WC2_s1x.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1432ed59d082f47a8896e10c638bfe57176dad99 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_DL_WC2_s1x.yaml @@ -0,0 +1,16 @@ +_BASE_: "Base-DensePose-RCNN-FPN.yaml" +MODEL: + WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" + RESNETS: + DEPTH: 50 + ROI_DENSEPOSE_HEAD: + NAME: "DensePoseDeepLabHead" + UV_CONFIDENCE: + ENABLED: True + TYPE: "indep_aniso" + POINT_REGRESSION_WEIGHTS: 0.0005 +SOLVER: + CLIP_GRADIENTS: + ENABLED: True + MAX_ITER: 130000 + STEPS: (100000, 120000) diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_DL_s1x.yaml b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_DL_s1x.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d81a769457396d20fc30e1671903ad284de536f2 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_DL_s1x.yaml @@ -0,0 +1,10 @@ +_BASE_: "Base-DensePose-RCNN-FPN.yaml" +MODEL: + WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" + RESNETS: + DEPTH: 50 + ROI_DENSEPOSE_HEAD: + NAME: "DensePoseDeepLabHead" +SOLVER: + MAX_ITER: 130000 + STEPS: (100000, 120000) diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_WC1_s1x.yaml b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_WC1_s1x.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5580d5459b098d59acbeb59e6172e91bf292d860 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_WC1_s1x.yaml @@ -0,0 +1,16 @@ +_BASE_: "Base-DensePose-RCNN-FPN.yaml" +MODEL: + WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" + RESNETS: + DEPTH: 50 + ROI_DENSEPOSE_HEAD: + UV_CONFIDENCE: + ENABLED: True + TYPE: "iid_iso" + POINT_REGRESSION_WEIGHTS: 0.0005 +SOLVER: + CLIP_GRADIENTS: + ENABLED: True + MAX_ITER: 130000 + STEPS: (100000, 120000) + WARMUP_FACTOR: 0.025 diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_WC2_s1x.yaml b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_WC2_s1x.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5a2d3e51fea69af9a555103f40f52d07a7b73e9e --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_WC2_s1x.yaml @@ -0,0 +1,16 @@ +_BASE_: "Base-DensePose-RCNN-FPN.yaml" +MODEL: + WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" + RESNETS: + DEPTH: 50 + ROI_DENSEPOSE_HEAD: + UV_CONFIDENCE: + ENABLED: True + TYPE: "indep_aniso" + POINT_REGRESSION_WEIGHTS: 0.0005 +SOLVER: + CLIP_GRADIENTS: + ENABLED: True + MAX_ITER: 130000 + STEPS: (100000, 120000) + WARMUP_FACTOR: 0.025 diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_s1x.yaml b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_s1x.yaml new file mode 100644 index 0000000000000000000000000000000000000000..72f64518b9914dfdbf01d426e04cda9e74574032 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_s1x.yaml @@ -0,0 +1,8 @@ +_BASE_: "Base-DensePose-RCNN-FPN.yaml" +MODEL: + WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" + RESNETS: + DEPTH: 50 +SOLVER: + MAX_ITER: 130000 + STEPS: (100000, 120000) diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_s1x_legacy.yaml b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_s1x_legacy.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5d025103fa374e7007b52a98abe6aa3d2f754763 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_s1x_legacy.yaml @@ -0,0 +1,17 @@ +_BASE_: "Base-DensePose-RCNN-FPN.yaml" +MODEL: + WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl" + RESNETS: + DEPTH: 50 + ROI_DENSEPOSE_HEAD: + NUM_COARSE_SEGM_CHANNELS: 15 + POOLER_RESOLUTION: 14 + HEATMAP_SIZE: 56 + INDEX_WEIGHTS: 2.0 + PART_WEIGHTS: 0.3 + POINT_REGRESSION_WEIGHTS: 0.1 + DECODER_ON: False +SOLVER: + BASE_LR: 0.002 + MAX_ITER: 130000 + STEPS: (100000, 120000) diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/densepose/__init__.py b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/densepose/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fd276deb945b8b0e6fa79edb0d599d021a63295c --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/densepose/__init__.py @@ -0,0 +1,9 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +from .data.datasets import builtin # just to register data +from .config import add_densepose_config, add_dataset_category_config +from .densepose_head import ROI_DENSEPOSE_HEAD_REGISTRY +from .evaluator import DensePoseCOCOEvaluator +from .roi_head import DensePoseROIHeads +from .data.structures import DensePoseDataRelative, DensePoseList, DensePoseTransformData +from .modeling.test_time_augmentation import DensePoseGeneralizedRCNNWithTTA +from .utils.transform import load_from_cfg diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/densepose/config.py b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/densepose/config.py new file mode 100644 index 0000000000000000000000000000000000000000..f6ccd1746cc196eacaad4bfdb7dbd5a4964dca0a --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/densepose/config.py @@ -0,0 +1,68 @@ +# -*- coding = utf-8 -*- +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved + +from detectron2.config import CfgNode as CN + + +def add_dataset_category_config(cfg: CN): + """ + Add config for additional category-related dataset options + - category whitelisting + - category mapping + """ + _C = cfg + _C.DATASETS.CATEGORY_MAPS = CN(new_allowed=True) + _C.DATASETS.WHITELISTED_CATEGORIES = CN(new_allowed=True) + + +def add_densepose_config(cfg: CN): + """ + Add config for densepose head. + """ + _C = cfg + + _C.MODEL.DENSEPOSE_ON = True + + _C.MODEL.ROI_DENSEPOSE_HEAD = CN() + _C.MODEL.ROI_DENSEPOSE_HEAD.NAME = "" + _C.MODEL.ROI_DENSEPOSE_HEAD.NUM_STACKED_CONVS = 8 + # Number of parts used for point labels + _C.MODEL.ROI_DENSEPOSE_HEAD.NUM_PATCHES = 24 + _C.MODEL.ROI_DENSEPOSE_HEAD.DECONV_KERNEL = 4 + _C.MODEL.ROI_DENSEPOSE_HEAD.CONV_HEAD_DIM = 512 + _C.MODEL.ROI_DENSEPOSE_HEAD.CONV_HEAD_KERNEL = 3 + _C.MODEL.ROI_DENSEPOSE_HEAD.UP_SCALE = 2 + _C.MODEL.ROI_DENSEPOSE_HEAD.HEATMAP_SIZE = 112 + _C.MODEL.ROI_DENSEPOSE_HEAD.POOLER_TYPE = "ROIAlignV2" + _C.MODEL.ROI_DENSEPOSE_HEAD.POOLER_RESOLUTION = 28 + _C.MODEL.ROI_DENSEPOSE_HEAD.POOLER_SAMPLING_RATIO = 2 + _C.MODEL.ROI_DENSEPOSE_HEAD.NUM_COARSE_SEGM_CHANNELS = 2 # 15 or 2 + # Overlap threshold for an RoI to be considered foreground (if >= FG_IOU_THRESHOLD) + _C.MODEL.ROI_DENSEPOSE_HEAD.FG_IOU_THRESHOLD = 0.7 + # Loss weights for annotation masks.(14 Parts) + _C.MODEL.ROI_DENSEPOSE_HEAD.INDEX_WEIGHTS = 5.0 + # Loss weights for surface parts. (24 Parts) + _C.MODEL.ROI_DENSEPOSE_HEAD.PART_WEIGHTS = 1.0 + # Loss weights for UV regression. + _C.MODEL.ROI_DENSEPOSE_HEAD.POINT_REGRESSION_WEIGHTS = 0.01 + # For Decoder + _C.MODEL.ROI_DENSEPOSE_HEAD.DECODER_ON = True + _C.MODEL.ROI_DENSEPOSE_HEAD.DECODER_NUM_CLASSES = 256 + _C.MODEL.ROI_DENSEPOSE_HEAD.DECODER_CONV_DIMS = 256 + _C.MODEL.ROI_DENSEPOSE_HEAD.DECODER_NORM = "" + _C.MODEL.ROI_DENSEPOSE_HEAD.DECODER_COMMON_STRIDE = 4 + # For DeepLab head + _C.MODEL.ROI_DENSEPOSE_HEAD.DEEPLAB = CN() + _C.MODEL.ROI_DENSEPOSE_HEAD.DEEPLAB.NORM = "GN" + _C.MODEL.ROI_DENSEPOSE_HEAD.DEEPLAB.NONLOCAL_ON = 0 + # Confidences + # Enable learning confidences (variances) along with the actual values + _C.MODEL.ROI_DENSEPOSE_HEAD.UV_CONFIDENCE = CN({"ENABLED": False}) + # UV confidence lower bound + _C.MODEL.ROI_DENSEPOSE_HEAD.UV_CONFIDENCE.EPSILON = 0.01 + # Statistical model type for confidence learning, possible values: + # - "iid_iso": statistically independent identically distributed residuals + # with isotropic covariance + # - "indep_aniso": statistically independent residuals with anisotropic + # covariances + _C.MODEL.ROI_DENSEPOSE_HEAD.UV_CONFIDENCE.TYPE = "iid_iso" diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/densepose/densepose_coco_evaluation.py b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/densepose/densepose_coco_evaluation.py new file mode 100644 index 0000000000000000000000000000000000000000..e28ce4b98521d219bfbcbea9c678ce37964203b1 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/densepose/densepose_coco_evaluation.py @@ -0,0 +1,1138 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. +# This is a modified version of cocoeval.py where we also have the densepose evaluation. + +__author__ = "tsungyi" + +import copy +import datetime +import itertools +import logging +import numpy as np +import pickle +import time +from collections import defaultdict +from enum import Enum +from typing import Any, Dict, Tuple +import scipy.spatial.distance as ssd +from fvcore.common.file_io import PathManager +from pycocotools import mask as maskUtils +from scipy.io import loadmat +from scipy.ndimage import zoom as spzoom + +from .data.structures import DensePoseDataRelative, DensePoseResult + +logger = logging.getLogger(__name__) + + +class DensePoseEvalMode(str, Enum): + # use both masks and geodesic distances (GPS * IOU) to compute scores + GPSM = "gpsm" + # use only geodesic distances (GPS) to compute scores + GPS = "gps" + # use only masks (IOU) to compute scores + IOU = "iou" + + +class DensePoseDataMode(str, Enum): + # use estimated IUV data (default mode) + IUV_DT = "iuvdt" + # use ground truth IUV data + IUV_GT = "iuvgt" + # use ground truth labels I and set UV to 0 + I_GT_UV_0 = "igtuv0" + # use ground truth labels I and estimated UV coordinates + I_GT_UV_DT = "igtuvdt" + # use estimated labels I and set UV to 0 + I_DT_UV_0 = "idtuv0" + + +class DensePoseCocoEval(object): + # Interface for evaluating detection on the Microsoft COCO dataset. + # + # The usage for CocoEval is as follows: + # cocoGt=..., cocoDt=... # load dataset and results + # E = CocoEval(cocoGt,cocoDt); # initialize CocoEval object + # E.params.recThrs = ...; # set parameters as desired + # E.evaluate(); # run per image evaluation + # E.accumulate(); # accumulate per image results + # E.summarize(); # display summary metrics of results + # For example usage see evalDemo.m and http://mscoco.org/. + # + # The evaluation parameters are as follows (defaults in brackets): + # imgIds - [all] N demo ids to use for evaluation + # catIds - [all] K cat ids to use for evaluation + # iouThrs - [.5:.05:.95] T=10 IoU thresholds for evaluation + # recThrs - [0:.01:1] R=101 recall thresholds for evaluation + # areaRng - [...] A=4 object area ranges for evaluation + # maxDets - [1 10 100] M=3 thresholds on max detections per image + # iouType - ['segm'] set iouType to 'segm', 'bbox', 'keypoints' or 'densepose' + # iouType replaced the now DEPRECATED useSegm parameter. + # useCats - [1] if true use category labels for evaluation + # Note: if useCats=0 category labels are ignored as in proposal scoring. + # Note: multiple areaRngs [Ax2] and maxDets [Mx1] can be specified. + # + # evaluate(): evaluates detections on every image and every category and + # concats the results into the "evalImgs" with fields: + # dtIds - [1xD] id for each of the D detections (dt) + # gtIds - [1xG] id for each of the G ground truths (gt) + # dtMatches - [TxD] matching gt id at each IoU or 0 + # gtMatches - [TxG] matching dt id at each IoU or 0 + # dtScores - [1xD] confidence of each dt + # gtIgnore - [1xG] ignore flag for each gt + # dtIgnore - [TxD] ignore flag for each dt at each IoU + # + # accumulate(): accumulates the per-image, per-category evaluation + # results in "evalImgs" into the dictionary "eval" with fields: + # params - parameters used for evaluation + # date - date evaluation was performed + # counts - [T,R,K,A,M] parameter dimensions (see above) + # precision - [TxRxKxAxM] precision for every evaluation setting + # recall - [TxKxAxM] max recall for every evaluation setting + # Note: precision and recall==-1 for settings with no gt objects. + # + # See also coco, mask, pycocoDemo, pycocoEvalDemo + # + # Microsoft COCO Toolbox. version 2.0 + # Data, paper, and tutorials available at: http://mscoco.org/ + # Code written by Piotr Dollar and Tsung-Yi Lin, 2015. + # Licensed under the Simplified BSD License [see coco/license.txt] + def __init__( + self, + cocoGt=None, + cocoDt=None, + iouType: str = "densepose", + dpEvalMode: DensePoseEvalMode = DensePoseEvalMode.GPS, + dpDataMode: DensePoseDataMode = DensePoseDataMode.IUV_DT, + ): + """ + Initialize CocoEval using coco APIs for gt and dt + :param cocoGt: coco object with ground truth annotations + :param cocoDt: coco object with detection results + :return: None + """ + self.cocoGt = cocoGt # ground truth COCO API + self.cocoDt = cocoDt # detections COCO API + self._dpEvalMode = dpEvalMode + self._dpDataMode = dpDataMode + self.params = {} # evaluation parameters + self.evalImgs = defaultdict(list) # per-image per-category eval results [KxAxI] + self.eval = {} # accumulated evaluation results + self._gts = defaultdict(list) # gt for evaluation + self._dts = defaultdict(list) # dt for evaluation + self.params = Params(iouType=iouType) # parameters + self._paramsEval = {} # parameters for evaluation + self.stats = [] # result summarization + self.ious = {} # ious between all gts and dts + if cocoGt is not None: + self.params.imgIds = sorted(cocoGt.getImgIds()) + self.params.catIds = sorted(cocoGt.getCatIds()) + self.ignoreThrBB = 0.7 + self.ignoreThrUV = 0.9 + + def _loadGEval(self): + smpl_subdiv_fpath = PathManager.get_local_path( + "https://dl.fbaipublicfiles.com/densepose/data/SMPL_subdiv.mat" + ) + pdist_transform_fpath = PathManager.get_local_path( + "https://dl.fbaipublicfiles.com/densepose/data/SMPL_SUBDIV_TRANSFORM.mat" + ) + pdist_matrix_fpath = PathManager.get_local_path( + "https://dl.fbaipublicfiles.com/densepose/data/Pdist_matrix.pkl", timeout_sec=120 + ) + SMPL_subdiv = loadmat(smpl_subdiv_fpath) + self.PDIST_transform = loadmat(pdist_transform_fpath) + self.PDIST_transform = self.PDIST_transform["index"].squeeze() + UV = np.array([SMPL_subdiv["U_subdiv"], SMPL_subdiv["V_subdiv"]]).squeeze() + ClosestVertInds = np.arange(UV.shape[1]) + 1 + self.Part_UVs = [] + self.Part_ClosestVertInds = [] + for i in np.arange(24): + self.Part_UVs.append(UV[:, SMPL_subdiv["Part_ID_subdiv"].squeeze() == (i + 1)]) + self.Part_ClosestVertInds.append( + ClosestVertInds[SMPL_subdiv["Part_ID_subdiv"].squeeze() == (i + 1)] + ) + + with open(pdist_matrix_fpath, "rb") as hFile: + arrays = pickle.load(hFile, encoding="latin1") + self.Pdist_matrix = arrays["Pdist_matrix"] + self.Part_ids = np.array(SMPL_subdiv["Part_ID_subdiv"].squeeze()) + # Mean geodesic distances for parts. + self.Mean_Distances = np.array([0, 0.351, 0.107, 0.126, 0.237, 0.173, 0.142, 0.128, 0.150]) + # Coarse Part labels. + self.CoarseParts = np.array( + [0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8] + ) + + def _prepare(self): + """ + Prepare ._gts and ._dts for evaluation based on params + :return: None + """ + + def _toMask(anns, coco): + # modify ann['segmentation'] by reference + for ann in anns: + rle = coco.annToRLE(ann) + ann["segmentation"] = rle + + def _getIgnoreRegion(iid, coco): + img = coco.imgs[iid] + + if "ignore_regions_x" not in img.keys(): + return None + + if len(img["ignore_regions_x"]) == 0: + return None + + rgns_merged = [] + for region_x, region_y in zip(img["ignore_regions_x"], img["ignore_regions_y"]): + rgns = [iter(region_x), iter(region_y)] + rgns_merged.append([next(it) for it in itertools.cycle(rgns)]) + rles = maskUtils.frPyObjects(rgns_merged, img["height"], img["width"]) + rle = maskUtils.merge(rles) + return maskUtils.decode(rle) + + def _checkIgnore(dt, iregion): + if iregion is None: + return True + + bb = np.array(dt["bbox"]).astype(np.int) + x1, y1, x2, y2 = bb[0], bb[1], bb[0] + bb[2], bb[1] + bb[3] + x2 = min([x2, iregion.shape[1]]) + y2 = min([y2, iregion.shape[0]]) + + if bb[2] * bb[3] == 0: + return False + + crop_iregion = iregion[y1:y2, x1:x2] + + if crop_iregion.sum() == 0: + return True + + if "densepose" not in dt.keys(): # filtering boxes + return crop_iregion.sum() / bb[2] / bb[3] < self.ignoreThrBB + + # filtering UVs + ignoremask = np.require(crop_iregion, requirements=["F"]) + mask = self._extract_mask(dt) + uvmask = np.require(np.asarray(mask > 0), dtype=np.uint8, requirements=["F"]) + uvmask_ = maskUtils.encode(uvmask) + ignoremask_ = maskUtils.encode(ignoremask) + uviou = maskUtils.iou([uvmask_], [ignoremask_], [1])[0] + return uviou < self.ignoreThrUV + + p = self.params + + if p.useCats: + gts = self.cocoGt.loadAnns(self.cocoGt.getAnnIds(imgIds=p.imgIds, catIds=p.catIds)) + dts = self.cocoDt.loadAnns(self.cocoDt.getAnnIds(imgIds=p.imgIds, catIds=p.catIds)) + else: + gts = self.cocoGt.loadAnns(self.cocoGt.getAnnIds(imgIds=p.imgIds)) + dts = self.cocoDt.loadAnns(self.cocoDt.getAnnIds(imgIds=p.imgIds)) + + imns = self.cocoGt.loadImgs(p.imgIds) + self.size_mapping = {} + for im in imns: + self.size_mapping[im["id"]] = [im["height"], im["width"]] + + # if iouType == 'uv', add point gt annotations + if p.iouType == "densepose": + self._loadGEval() + + # convert ground truth to mask if iouType == 'segm' + if p.iouType == "segm": + _toMask(gts, self.cocoGt) + _toMask(dts, self.cocoDt) + + # set ignore flag + for gt in gts: + gt["ignore"] = gt["ignore"] if "ignore" in gt else 0 + gt["ignore"] = "iscrowd" in gt and gt["iscrowd"] + if p.iouType == "keypoints": + gt["ignore"] = (gt["num_keypoints"] == 0) or gt["ignore"] + if p.iouType == "densepose": + gt["ignore"] = ("dp_x" in gt) == 0 + + self._gts = defaultdict(list) # gt for evaluation + self._dts = defaultdict(list) # dt for evaluation + self._igrgns = defaultdict(list) + + for gt in gts: + iid = gt["image_id"] + if iid not in self._igrgns.keys(): + self._igrgns[iid] = _getIgnoreRegion(iid, self.cocoGt) + if _checkIgnore(gt, self._igrgns[iid]): + self._gts[iid, gt["category_id"]].append(gt) + for dt in dts: + iid = dt["image_id"] + if (iid not in self._igrgns) or _checkIgnore(dt, self._igrgns[iid]): + self._dts[iid, dt["category_id"]].append(dt) + + self.evalImgs = defaultdict(list) # per-image per-category evaluation results + self.eval = {} # accumulated evaluation results + + def evaluate(self): + """ + Run per image evaluation on given images and store results (a list of dict) in self.evalImgs + :return: None + """ + tic = time.time() + logger.info("Running per image DensePose evaluation... {}".format(self.params.iouType)) + p = self.params + # add backward compatibility if useSegm is specified in params + if p.useSegm is not None: + p.iouType = "segm" if p.useSegm == 1 else "bbox" + logger.info("useSegm (deprecated) is not None. Running DensePose evaluation") + p.imgIds = list(np.unique(p.imgIds)) + if p.useCats: + p.catIds = list(np.unique(p.catIds)) + p.maxDets = sorted(p.maxDets) + self.params = p + + self._prepare() + # loop through images, area range, max detection number + catIds = p.catIds if p.useCats else [-1] + + if p.iouType in ["segm", "bbox"]: + computeIoU = self.computeIoU + elif p.iouType == "keypoints": + computeIoU = self.computeOks + elif p.iouType == "densepose": + computeIoU = self.computeOgps + if self._dpEvalMode == DensePoseEvalMode.GPSM: + self.real_ious = { + (imgId, catId): self.computeDPIoU(imgId, catId) + for imgId in p.imgIds + for catId in catIds + } + + self.ious = { + (imgId, catId): computeIoU(imgId, catId) for imgId in p.imgIds for catId in catIds + } + + evaluateImg = self.evaluateImg + maxDet = p.maxDets[-1] + self.evalImgs = [ + evaluateImg(imgId, catId, areaRng, maxDet) + for catId in catIds + for areaRng in p.areaRng + for imgId in p.imgIds + ] + self._paramsEval = copy.deepcopy(self.params) + toc = time.time() + logger.info("DensePose evaluation DONE (t={:0.2f}s).".format(toc - tic)) + + def getDensePoseMask(self, polys): + maskGen = np.zeros([256, 256]) + for i in range(1, 15): + if polys[i - 1]: + currentMask = maskUtils.decode(polys[i - 1]) + maskGen[currentMask > 0] = i + return maskGen + + def _generate_rlemask_on_image(self, mask, imgId, data): + bbox_xywh = np.array(data["bbox"]) + x, y, w, h = bbox_xywh + im_h, im_w = self.size_mapping[imgId] + im_mask = np.zeros((im_h, im_w), dtype=np.uint8) + if mask is not None: + x0 = max(int(x), 0) + x1 = min(int(x + w), im_w, int(x) + mask.shape[1]) + y0 = max(int(y), 0) + y1 = min(int(y + h), im_h, int(y) + mask.shape[0]) + y = int(y) + x = int(x) + im_mask[y0:y1, x0:x1] = mask[y0 - y : y1 - y, x0 - x : x1 - x] + im_mask = np.require(np.asarray(im_mask > 0), dtype=np.uint8, requirements=["F"]) + rle_mask = maskUtils.encode(np.array(im_mask[:, :, np.newaxis], order="F"))[0] + return rle_mask + + def computeDPIoU(self, imgId, catId): + p = self.params + if p.useCats: + gt = self._gts[imgId, catId] + dt = self._dts[imgId, catId] + else: + gt = [_ for cId in p.catIds for _ in self._gts[imgId, cId]] + dt = [_ for cId in p.catIds for _ in self._dts[imgId, cId]] + if len(gt) == 0 and len(dt) == 0: + return [] + inds = np.argsort([-d["score"] for d in dt], kind="mergesort") + dt = [dt[i] for i in inds] + if len(dt) > p.maxDets[-1]: + dt = dt[0 : p.maxDets[-1]] + + gtmasks = [] + for g in gt: + if DensePoseDataRelative.S_KEY in g: + mask = self.getDensePoseMask(g[DensePoseDataRelative.S_KEY]) + _, _, w, h = g["bbox"] + scale_x = float(max(w, 1)) / mask.shape[1] + scale_y = float(max(h, 1)) / mask.shape[0] + mask = spzoom(mask, (scale_y, scale_x), order=1, prefilter=False) + mask = np.array(mask > 0.5, dtype=np.uint8) + rle_mask = self._generate_rlemask_on_image(mask, imgId, g) + elif "segmentation" in g: + segmentation = g["segmentation"] + if isinstance(segmentation, list) and segmentation: + # polygons + im_h, im_w = self.size_mapping[imgId] + rles = maskUtils.frPyObjects(segmentation, im_h, im_w) + rle_mask = maskUtils.merge(rles) + elif isinstance(segmentation, dict): + if isinstance(segmentation["counts"], list): + # uncompressed RLE + im_h, im_w = self.size_mapping[imgId] + rle_mask = maskUtils.frPyObjects(segmentation, im_h, im_w) + else: + # compressed RLE + rle_mask = segmentation + else: + rle_mask = self._generate_rlemask_on_image(None, imgId, g) + else: + rle_mask = self._generate_rlemask_on_image(None, imgId, g) + gtmasks.append(rle_mask) + + dtmasks = [] + for d in dt: + mask = self._extract_mask(d) + mask = np.require(np.asarray(mask > 0), dtype=np.uint8, requirements=["F"]) + rle_mask = self._generate_rlemask_on_image(mask, imgId, d) + dtmasks.append(rle_mask) + + # compute iou between each dt and gt region + iscrowd = [int(o["iscrowd"]) for o in gt] + iousDP = maskUtils.iou(dtmasks, gtmasks, iscrowd) + return iousDP + + def computeIoU(self, imgId, catId): + p = self.params + if p.useCats: + gt = self._gts[imgId, catId] + dt = self._dts[imgId, catId] + else: + gt = [_ for cId in p.catIds for _ in self._gts[imgId, cId]] + dt = [_ for cId in p.catIds for _ in self._dts[imgId, cId]] + if len(gt) == 0 and len(dt) == 0: + return [] + inds = np.argsort([-d["score"] for d in dt], kind="mergesort") + dt = [dt[i] for i in inds] + if len(dt) > p.maxDets[-1]: + dt = dt[0 : p.maxDets[-1]] + + if p.iouType == "segm": + g = [g["segmentation"] for g in gt] + d = [d["segmentation"] for d in dt] + elif p.iouType == "bbox": + g = [g["bbox"] for g in gt] + d = [d["bbox"] for d in dt] + else: + raise Exception("unknown iouType for iou computation") + + # compute iou between each dt and gt region + iscrowd = [int(o["iscrowd"]) for o in gt] + ious = maskUtils.iou(d, g, iscrowd) + return ious + + def computeOks(self, imgId, catId): + p = self.params + # dimension here should be Nxm + gts = self._gts[imgId, catId] + dts = self._dts[imgId, catId] + inds = np.argsort([-d["score"] for d in dts], kind="mergesort") + dts = [dts[i] for i in inds] + if len(dts) > p.maxDets[-1]: + dts = dts[0 : p.maxDets[-1]] + # if len(gts) == 0 and len(dts) == 0: + if len(gts) == 0 or len(dts) == 0: + return [] + ious = np.zeros((len(dts), len(gts))) + sigmas = ( + np.array( + [ + 0.26, + 0.25, + 0.25, + 0.35, + 0.35, + 0.79, + 0.79, + 0.72, + 0.72, + 0.62, + 0.62, + 1.07, + 1.07, + 0.87, + 0.87, + 0.89, + 0.89, + ] + ) + / 10.0 + ) + vars = (sigmas * 2) ** 2 + k = len(sigmas) + # compute oks between each detection and ground truth object + for j, gt in enumerate(gts): + # create bounds for ignore regions(double the gt bbox) + g = np.array(gt["keypoints"]) + xg = g[0::3] + yg = g[1::3] + vg = g[2::3] + k1 = np.count_nonzero(vg > 0) + bb = gt["bbox"] + x0 = bb[0] - bb[2] + x1 = bb[0] + bb[2] * 2 + y0 = bb[1] - bb[3] + y1 = bb[1] + bb[3] * 2 + for i, dt in enumerate(dts): + d = np.array(dt["keypoints"]) + xd = d[0::3] + yd = d[1::3] + if k1 > 0: + # measure the per-keypoint distance if keypoints visible + dx = xd - xg + dy = yd - yg + else: + # measure minimum distance to keypoints in (x0,y0) & (x1,y1) + z = np.zeros(k) + dx = np.max((z, x0 - xd), axis=0) + np.max((z, xd - x1), axis=0) + dy = np.max((z, y0 - yd), axis=0) + np.max((z, yd - y1), axis=0) + e = (dx ** 2 + dy ** 2) / vars / (gt["area"] + np.spacing(1)) / 2 + if k1 > 0: + e = e[vg > 0] + ious[i, j] = np.sum(np.exp(-e)) / e.shape[0] + return ious + + def _extract_mask(self, dt: Dict[str, Any]) -> np.ndarray: + (densepose_shape, densepose_data_encoded), densepose_bbox_xywh = dt["densepose"] + densepose_data = DensePoseResult.decode_png_data(densepose_shape, densepose_data_encoded) + return densepose_data[0] + + def _extract_iuv( + self, densepose_data: np.ndarray, py: np.ndarray, px: np.ndarray, gt: Dict[str, Any] + ) -> Tuple[np.ndarray, np.ndarray, np.ndarray]: + """ + Extract arrays of I, U and V values at given points as numpy arrays + given the data mode stored in self._dpDataMode + """ + if self._dpDataMode == DensePoseDataMode.IUV_DT: + # estimated labels and UV (default) + ipoints = densepose_data[0, py, px] + upoints = densepose_data[1, py, px] / 255.0 # convert from uint8 by /255. + vpoints = densepose_data[2, py, px] / 255.0 + elif self._dpDataMode == DensePoseDataMode.IUV_GT: + # ground truth + ipoints = np.array(gt["dp_I"]) + upoints = np.array(gt["dp_U"]) + vpoints = np.array(gt["dp_V"]) + elif self._dpDataMode == DensePoseDataMode.I_GT_UV_0: + # ground truth labels, UV = 0 + ipoints = np.array(gt["dp_I"]) + upoints = upoints * 0.0 + vpoints = vpoints * 0.0 + elif self._dpDataMode == DensePoseDataMode.I_GT_UV_DT: + # ground truth labels, estimated UV + ipoints = np.array(gt["dp_I"]) + upoints = densepose_data[1, py, px] / 255.0 # convert from uint8 by /255. + vpoints = densepose_data[2, py, px] / 255.0 + elif self._dpDataMode == DensePoseDataMode.I_DT_UV_0: + # estimated labels, UV = 0 + ipoints = densepose_data[0, py, px] + upoints = upoints * 0.0 + vpoints = vpoints * 0.0 + else: + raise ValueError(f"Unknown data mode: {self._dpDataMode}") + return ipoints, upoints, vpoints + + def computeOgps(self, imgId, catId): + p = self.params + # dimension here should be Nxm + g = self._gts[imgId, catId] + d = self._dts[imgId, catId] + inds = np.argsort([-d_["score"] for d_ in d], kind="mergesort") + d = [d[i] for i in inds] + if len(d) > p.maxDets[-1]: + d = d[0 : p.maxDets[-1]] + # if len(gts) == 0 and len(dts) == 0: + if len(g) == 0 or len(d) == 0: + return [] + ious = np.zeros((len(d), len(g))) + # compute opgs between each detection and ground truth object + # sigma = self.sigma #0.255 # dist = 0.3m corresponds to ogps = 0.5 + # 1 # dist = 0.3m corresponds to ogps = 0.96 + # 1.45 # dist = 1.7m (person height) corresponds to ogps = 0.5) + for j, gt in enumerate(g): + if not gt["ignore"]: + g_ = gt["bbox"] + for i, dt in enumerate(d): + # + dy = int(dt["bbox"][3]) + dx = int(dt["bbox"][2]) + dp_x = np.array(gt["dp_x"]) * g_[2] / 255.0 + dp_y = np.array(gt["dp_y"]) * g_[3] / 255.0 + py = (dp_y + g_[1] - dt["bbox"][1]).astype(np.int) + px = (dp_x + g_[0] - dt["bbox"][0]).astype(np.int) + # + pts = np.zeros(len(px)) + pts[px >= dx] = -1 + pts[py >= dy] = -1 + pts[px < 0] = -1 + pts[py < 0] = -1 + if len(pts) < 1: + ogps = 0.0 + elif np.max(pts) == -1: + ogps = 0.0 + else: + px[pts == -1] = 0 + py[pts == -1] = 0 + (densepose_shape, densepose_data_encoded), densepose_bbox_xywh = dt[ + "densepose" + ] + densepose_data = DensePoseResult.decode_png_data( + densepose_shape, densepose_data_encoded + ) + assert densepose_data.shape[2] == dx, ( + "DensePoseData width {} should be equal to " + "detection bounding box width {}".format(densepose_data.shape[2], dx) + ) + assert densepose_data.shape[1] == dy, ( + "DensePoseData height {} should be equal to " + "detection bounding box height {}".format(densepose_data.shape[1], dy) + ) + ipoints, upoints, vpoints = self._extract_iuv(densepose_data, py, px, gt) + ipoints[pts == -1] = 0 + # Find closest vertices in subsampled mesh. + cVerts, cVertsGT = self.findAllClosestVerts(gt, upoints, vpoints, ipoints) + # Get pairwise geodesic distances between gt and estimated mesh points. + dist = self.getDistances(cVertsGT, cVerts) + # Compute the Ogps measure. + # Find the mean geodesic normalization distance for + # each GT point, based on which part it is on. + Current_Mean_Distances = self.Mean_Distances[ + self.CoarseParts[self.Part_ids[cVertsGT[cVertsGT > 0].astype(int) - 1]] + ] + # Compute gps + ogps_values = np.exp(-(dist ** 2) / (2 * (Current_Mean_Distances ** 2))) + # + if len(dist) > 0: + ogps = np.sum(ogps_values) / len(dist) + ious[i, j] = ogps + + gbb = [gt["bbox"] for gt in g] + dbb = [dt["bbox"] for dt in d] + + # compute iou between each dt and gt region + iscrowd = [int(o["iscrowd"]) for o in g] + ious_bb = maskUtils.iou(dbb, gbb, iscrowd) + return ious, ious_bb + + def evaluateImg(self, imgId, catId, aRng, maxDet): + """ + perform evaluation for single category and image + :return: dict (single image results) + """ + + p = self.params + if p.useCats: + gt = self._gts[imgId, catId] + dt = self._dts[imgId, catId] + else: + gt = [_ for cId in p.catIds for _ in self._gts[imgId, cId]] + dt = [_ for cId in p.catIds for _ in self._dts[imgId, cId]] + if len(gt) == 0 and len(dt) == 0: + return None + + for g in gt: + # g['_ignore'] = g['ignore'] + if g["ignore"] or (g["area"] < aRng[0] or g["area"] > aRng[1]): + g["_ignore"] = True + else: + g["_ignore"] = False + + # sort dt highest score first, sort gt ignore last + gtind = np.argsort([g["_ignore"] for g in gt], kind="mergesort") + gt = [gt[i] for i in gtind] + dtind = np.argsort([-d["score"] for d in dt], kind="mergesort") + dt = [dt[i] for i in dtind[0:maxDet]] + iscrowd = [int(o["iscrowd"]) for o in gt] + # load computed ious + if p.iouType == "densepose": + # print('Checking the length', len(self.ious[imgId, catId])) + # if len(self.ious[imgId, catId]) == 0: + # print(self.ious[imgId, catId]) + ious = ( + self.ious[imgId, catId][0][:, gtind] + if len(self.ious[imgId, catId]) > 0 + else self.ious[imgId, catId] + ) + ioubs = ( + self.ious[imgId, catId][1][:, gtind] + if len(self.ious[imgId, catId]) > 0 + else self.ious[imgId, catId] + ) + if self._dpEvalMode == DensePoseEvalMode.GPSM: + iousM = ( + self.real_ious[imgId, catId][:, gtind] + if len(self.real_ious[imgId, catId]) > 0 + else self.real_ious[imgId, catId] + ) + else: + ious = ( + self.ious[imgId, catId][:, gtind] + if len(self.ious[imgId, catId]) > 0 + else self.ious[imgId, catId] + ) + + T = len(p.iouThrs) + G = len(gt) + D = len(dt) + gtm = np.zeros((T, G)) + dtm = np.zeros((T, D)) + gtIg = np.array([g["_ignore"] for g in gt]) + dtIg = np.zeros((T, D)) + if np.all(gtIg) and p.iouType == "densepose": + dtIg = np.logical_or(dtIg, True) + + if len(ious) > 0: # and not p.iouType == 'densepose': + for tind, t in enumerate(p.iouThrs): + for dind, d in enumerate(dt): + # information about best match so far (m=-1 -> unmatched) + iou = min([t, 1 - 1e-10]) + m = -1 + for gind, _g in enumerate(gt): + # if this gt already matched, and not a crowd, continue + if gtm[tind, gind] > 0 and not iscrowd[gind]: + continue + # if dt matched to reg gt, and on ignore gt, stop + if m > -1 and gtIg[m] == 0 and gtIg[gind] == 1: + break + if p.iouType == "densepose": + if self._dpEvalMode == DensePoseEvalMode.GPSM: + new_iou = np.sqrt(iousM[dind, gind] * ious[dind, gind]) + elif self._dpEvalMode == DensePoseEvalMode.IOU: + new_iou = iousM[dind, gind] + elif self._dpEvalMode == DensePoseEvalMode.GPS: + new_iou = ious[dind, gind] + else: + new_iou = ious[dind, gind] + if new_iou < iou: + continue + if new_iou == 0.0: + continue + # if match successful and best so far, store appropriately + iou = new_iou + m = gind + # if match made store id of match for both dt and gt + if m == -1: + continue + dtIg[tind, dind] = gtIg[m] + dtm[tind, dind] = gt[m]["id"] + gtm[tind, m] = d["id"] + + if p.iouType == "densepose": + if not len(ioubs) == 0: + for dind, d in enumerate(dt): + # information about best match so far (m=-1 -> unmatched) + if dtm[tind, dind] == 0: + ioub = 0.8 + m = -1 + for gind, _g in enumerate(gt): + # if this gt already matched, and not a crowd, continue + if gtm[tind, gind] > 0 and not iscrowd[gind]: + continue + # continue to next gt unless better match made + if ioubs[dind, gind] < ioub: + continue + # if match successful and best so far, store appropriately + ioub = ioubs[dind, gind] + m = gind + # if match made store id of match for both dt and gt + if m > -1: + dtIg[:, dind] = gtIg[m] + if gtIg[m]: + dtm[tind, dind] = gt[m]["id"] + gtm[tind, m] = d["id"] + # set unmatched detections outside of area range to ignore + a = np.array([d["area"] < aRng[0] or d["area"] > aRng[1] for d in dt]).reshape((1, len(dt))) + dtIg = np.logical_or(dtIg, np.logical_and(dtm == 0, np.repeat(a, T, 0))) + # store results for given image and category + # print('Done with the function', len(self.ious[imgId, catId])) + return { + "image_id": imgId, + "category_id": catId, + "aRng": aRng, + "maxDet": maxDet, + "dtIds": [d["id"] for d in dt], + "gtIds": [g["id"] for g in gt], + "dtMatches": dtm, + "gtMatches": gtm, + "dtScores": [d["score"] for d in dt], + "gtIgnore": gtIg, + "dtIgnore": dtIg, + } + + def accumulate(self, p=None): + """ + Accumulate per image evaluation results and store the result in self.eval + :param p: input params for evaluation + :return: None + """ + logger.info("Accumulating evaluation results...") + tic = time.time() + if not self.evalImgs: + logger.info("Please run evaluate() first") + # allows input customized parameters + if p is None: + p = self.params + p.catIds = p.catIds if p.useCats == 1 else [-1] + T = len(p.iouThrs) + R = len(p.recThrs) + K = len(p.catIds) if p.useCats else 1 + A = len(p.areaRng) + M = len(p.maxDets) + precision = -(np.ones((T, R, K, A, M))) # -1 for the precision of absent categories + recall = -(np.ones((T, K, A, M))) + + # create dictionary for future indexing + logger.info("Categories: {}".format(p.catIds)) + _pe = self._paramsEval + catIds = _pe.catIds if _pe.useCats else [-1] + setK = set(catIds) + setA = set(map(tuple, _pe.areaRng)) + setM = set(_pe.maxDets) + setI = set(_pe.imgIds) + # get inds to evaluate + k_list = [n for n, k in enumerate(p.catIds) if k in setK] + m_list = [m for n, m in enumerate(p.maxDets) if m in setM] + a_list = [n for n, a in enumerate(map(lambda x: tuple(x), p.areaRng)) if a in setA] + i_list = [n for n, i in enumerate(p.imgIds) if i in setI] + I0 = len(_pe.imgIds) + A0 = len(_pe.areaRng) + # retrieve E at each category, area range, and max number of detections + for k, k0 in enumerate(k_list): + Nk = k0 * A0 * I0 + for a, a0 in enumerate(a_list): + Na = a0 * I0 + for m, maxDet in enumerate(m_list): + E = [self.evalImgs[Nk + Na + i] for i in i_list] + E = [e for e in E if e is not None] + if len(E) == 0: + continue + dtScores = np.concatenate([e["dtScores"][0:maxDet] for e in E]) + + # different sorting method generates slightly different results. + # mergesort is used to be consistent as Matlab implementation. + inds = np.argsort(-dtScores, kind="mergesort") + + dtm = np.concatenate([e["dtMatches"][:, 0:maxDet] for e in E], axis=1)[:, inds] + dtIg = np.concatenate([e["dtIgnore"][:, 0:maxDet] for e in E], axis=1)[:, inds] + gtIg = np.concatenate([e["gtIgnore"] for e in E]) + npig = np.count_nonzero(gtIg == 0) + if npig == 0: + continue + tps = np.logical_and(dtm, np.logical_not(dtIg)) + fps = np.logical_and(np.logical_not(dtm), np.logical_not(dtIg)) + tp_sum = np.cumsum(tps, axis=1).astype(dtype=np.float) + fp_sum = np.cumsum(fps, axis=1).astype(dtype=np.float) + for t, (tp, fp) in enumerate(zip(tp_sum, fp_sum)): + tp = np.array(tp) + fp = np.array(fp) + nd = len(tp) + rc = tp / npig + pr = tp / (fp + tp + np.spacing(1)) + q = np.zeros((R,)) + + if nd: + recall[t, k, a, m] = rc[-1] + else: + recall[t, k, a, m] = 0 + + # numpy is slow without cython optimization for accessing elements + # use python array gets significant speed improvement + pr = pr.tolist() + q = q.tolist() + + for i in range(nd - 1, 0, -1): + if pr[i] > pr[i - 1]: + pr[i - 1] = pr[i] + + inds = np.searchsorted(rc, p.recThrs, side="left") + try: + for ri, pi in enumerate(inds): + q[ri] = pr[pi] + except Exception: + pass + precision[t, :, k, a, m] = np.array(q) + logger.info( + "Final: max precision {}, min precision {}".format(np.max(precision), np.min(precision)) + ) + self.eval = { + "params": p, + "counts": [T, R, K, A, M], + "date": datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"), + "precision": precision, + "recall": recall, + } + toc = time.time() + logger.info("DONE (t={:0.2f}s).".format(toc - tic)) + + def summarize(self): + """ + Compute and display summary metrics for evaluation results. + Note this function can *only* be applied on the default parameter setting + """ + + def _summarize(ap=1, iouThr=None, areaRng="all", maxDets=100): + p = self.params + iStr = " {:<18} {} @[ {}={:<9} | area={:>6s} | maxDets={:>3d} ] = {:0.3f}" + titleStr = "Average Precision" if ap == 1 else "Average Recall" + typeStr = "(AP)" if ap == 1 else "(AR)" + measure = "IoU" + if self.params.iouType == "keypoints": + measure = "OKS" + elif self.params.iouType == "densepose": + measure = "OGPS" + iouStr = ( + "{:0.2f}:{:0.2f}".format(p.iouThrs[0], p.iouThrs[-1]) + if iouThr is None + else "{:0.2f}".format(iouThr) + ) + + aind = [i for i, aRng in enumerate(p.areaRngLbl) if aRng == areaRng] + mind = [i for i, mDet in enumerate(p.maxDets) if mDet == maxDets] + if ap == 1: + # dimension of precision: [TxRxKxAxM] + s = self.eval["precision"] + # IoU + if iouThr is not None: + t = np.where(np.abs(iouThr - p.iouThrs) < 0.001)[0] + s = s[t] + s = s[:, :, :, aind, mind] + else: + # dimension of recall: [TxKxAxM] + s = self.eval["recall"] + if iouThr is not None: + t = np.where(iouThr == p.iouThrs)[0] + s = s[t] + s = s[:, :, aind, mind] + if len(s[s > -1]) == 0: + mean_s = -1 + else: + mean_s = np.mean(s[s > -1]) + logger.info(iStr.format(titleStr, typeStr, measure, iouStr, areaRng, maxDets, mean_s)) + return mean_s + + def _summarizeDets(): + stats = np.zeros((12,)) + stats[0] = _summarize(1) + stats[1] = _summarize(1, iouThr=0.5, maxDets=self.params.maxDets[2]) + stats[2] = _summarize(1, iouThr=0.75, maxDets=self.params.maxDets[2]) + stats[3] = _summarize(1, areaRng="small", maxDets=self.params.maxDets[2]) + stats[4] = _summarize(1, areaRng="medium", maxDets=self.params.maxDets[2]) + stats[5] = _summarize(1, areaRng="large", maxDets=self.params.maxDets[2]) + stats[6] = _summarize(0, maxDets=self.params.maxDets[0]) + stats[7] = _summarize(0, maxDets=self.params.maxDets[1]) + stats[8] = _summarize(0, maxDets=self.params.maxDets[2]) + stats[9] = _summarize(0, areaRng="small", maxDets=self.params.maxDets[2]) + stats[10] = _summarize(0, areaRng="medium", maxDets=self.params.maxDets[2]) + stats[11] = _summarize(0, areaRng="large", maxDets=self.params.maxDets[2]) + return stats + + def _summarizeKps(): + stats = np.zeros((10,)) + stats[0] = _summarize(1, maxDets=20) + stats[1] = _summarize(1, maxDets=20, iouThr=0.5) + stats[2] = _summarize(1, maxDets=20, iouThr=0.75) + stats[3] = _summarize(1, maxDets=20, areaRng="medium") + stats[4] = _summarize(1, maxDets=20, areaRng="large") + stats[5] = _summarize(0, maxDets=20) + stats[6] = _summarize(0, maxDets=20, iouThr=0.5) + stats[7] = _summarize(0, maxDets=20, iouThr=0.75) + stats[8] = _summarize(0, maxDets=20, areaRng="medium") + stats[9] = _summarize(0, maxDets=20, areaRng="large") + return stats + + def _summarizeUvs(): + stats = np.zeros((10,)) + stats[0] = _summarize(1, maxDets=self.params.maxDets[0]) + stats[1] = _summarize(1, maxDets=self.params.maxDets[0], iouThr=0.5) + stats[2] = _summarize(1, maxDets=self.params.maxDets[0], iouThr=0.75) + stats[3] = _summarize(1, maxDets=self.params.maxDets[0], areaRng="medium") + stats[4] = _summarize(1, maxDets=self.params.maxDets[0], areaRng="large") + stats[5] = _summarize(0, maxDets=self.params.maxDets[0]) + stats[6] = _summarize(0, maxDets=self.params.maxDets[0], iouThr=0.5) + stats[7] = _summarize(0, maxDets=self.params.maxDets[0], iouThr=0.75) + stats[8] = _summarize(0, maxDets=self.params.maxDets[0], areaRng="medium") + stats[9] = _summarize(0, maxDets=self.params.maxDets[0], areaRng="large") + return stats + + def _summarizeUvsOld(): + stats = np.zeros((18,)) + stats[0] = _summarize(1, maxDets=self.params.maxDets[0]) + stats[1] = _summarize(1, maxDets=self.params.maxDets[0], iouThr=0.5) + stats[2] = _summarize(1, maxDets=self.params.maxDets[0], iouThr=0.55) + stats[3] = _summarize(1, maxDets=self.params.maxDets[0], iouThr=0.60) + stats[4] = _summarize(1, maxDets=self.params.maxDets[0], iouThr=0.65) + stats[5] = _summarize(1, maxDets=self.params.maxDets[0], iouThr=0.70) + stats[6] = _summarize(1, maxDets=self.params.maxDets[0], iouThr=0.75) + stats[7] = _summarize(1, maxDets=self.params.maxDets[0], iouThr=0.80) + stats[8] = _summarize(1, maxDets=self.params.maxDets[0], iouThr=0.85) + stats[9] = _summarize(1, maxDets=self.params.maxDets[0], iouThr=0.90) + stats[10] = _summarize(1, maxDets=self.params.maxDets[0], iouThr=0.95) + stats[11] = _summarize(1, maxDets=self.params.maxDets[0], areaRng="medium") + stats[12] = _summarize(1, maxDets=self.params.maxDets[0], areaRng="large") + stats[13] = _summarize(0, maxDets=self.params.maxDets[0]) + stats[14] = _summarize(0, maxDets=self.params.maxDets[0], iouThr=0.5) + stats[15] = _summarize(0, maxDets=self.params.maxDets[0], iouThr=0.75) + stats[16] = _summarize(0, maxDets=self.params.maxDets[0], areaRng="medium") + stats[17] = _summarize(0, maxDets=self.params.maxDets[0], areaRng="large") + return stats + + if not self.eval: + raise Exception("Please run accumulate() first") + iouType = self.params.iouType + if iouType in ["segm", "bbox"]: + summarize = _summarizeDets + elif iouType in ["keypoints"]: + summarize = _summarizeKps + elif iouType in ["densepose"]: + summarize = _summarizeUvs + self.stats = summarize() + + def __str__(self): + self.summarize() + + # ================ functions for dense pose ============================== + def findAllClosestVerts(self, gt, U_points, V_points, Index_points): + # + I_gt = np.array(gt["dp_I"]) + U_gt = np.array(gt["dp_U"]) + V_gt = np.array(gt["dp_V"]) + # + # print(I_gt) + # + ClosestVerts = np.ones(Index_points.shape) * -1 + for i in np.arange(24): + # + if sum(Index_points == (i + 1)) > 0: + UVs = np.array( + [U_points[Index_points == (i + 1)], V_points[Index_points == (i + 1)]] + ) + Current_Part_UVs = self.Part_UVs[i] + Current_Part_ClosestVertInds = self.Part_ClosestVertInds[i] + D = ssd.cdist(Current_Part_UVs.transpose(), UVs.transpose()).squeeze() + ClosestVerts[Index_points == (i + 1)] = Current_Part_ClosestVertInds[ + np.argmin(D, axis=0) + ] + # + ClosestVertsGT = np.ones(Index_points.shape) * -1 + for i in np.arange(24): + if sum(I_gt == (i + 1)) > 0: + UVs = np.array([U_gt[I_gt == (i + 1)], V_gt[I_gt == (i + 1)]]) + Current_Part_UVs = self.Part_UVs[i] + Current_Part_ClosestVertInds = self.Part_ClosestVertInds[i] + D = ssd.cdist(Current_Part_UVs.transpose(), UVs.transpose()).squeeze() + ClosestVertsGT[I_gt == (i + 1)] = Current_Part_ClosestVertInds[np.argmin(D, axis=0)] + # + return ClosestVerts, ClosestVertsGT + + def getDistances(self, cVertsGT, cVerts): + + ClosestVertsTransformed = self.PDIST_transform[cVerts.astype(int) - 1] + ClosestVertsGTTransformed = self.PDIST_transform[cVertsGT.astype(int) - 1] + # + ClosestVertsTransformed[cVerts < 0] = 0 + ClosestVertsGTTransformed[cVertsGT < 0] = 0 + # + cVertsGT = ClosestVertsGTTransformed + cVerts = ClosestVertsTransformed + # + n = 27554 + dists = [] + for d in range(len(cVertsGT)): + if cVertsGT[d] > 0: + if cVerts[d] > 0: + i = cVertsGT[d] - 1 + j = cVerts[d] - 1 + if j == i: + dists.append(0) + elif j > i: + ccc = i + i = j + j = ccc + i = n - i - 1 + j = n - j - 1 + k = (n * (n - 1) / 2) - (n - i) * ((n - i) - 1) / 2 + j - i - 1 + k = (n * n - n) / 2 - k - 1 + dists.append(self.Pdist_matrix[int(k)][0]) + else: + i = n - i - 1 + j = n - j - 1 + k = (n * (n - 1) / 2) - (n - i) * ((n - i) - 1) / 2 + j - i - 1 + k = (n * n - n) / 2 - k - 1 + dists.append(self.Pdist_matrix[int(k)][0]) + else: + dists.append(np.inf) + return np.atleast_1d(np.array(dists).squeeze()) + + +class Params: + """ + Params for coco evaluation api + """ + + def setDetParams(self): + self.imgIds = [] + self.catIds = [] + # np.arange causes trouble. the data point on arange is slightly larger than the true value + self.iouThrs = np.linspace(0.5, 0.95, np.round((0.95 - 0.5) / 0.05) + 1, endpoint=True) + self.recThrs = np.linspace(0.0, 1.00, np.round((1.00 - 0.0) / 0.01) + 1, endpoint=True) + self.maxDets = [1, 10, 100] + self.areaRng = [ + [0 ** 2, 1e5 ** 2], + [0 ** 2, 32 ** 2], + [32 ** 2, 96 ** 2], + [96 ** 2, 1e5 ** 2], + ] + self.areaRngLbl = ["all", "small", "medium", "large"] + self.useCats = 1 + + def setKpParams(self): + self.imgIds = [] + self.catIds = [] + # np.arange causes trouble. the data point on arange is slightly larger than the true value + self.iouThrs = np.linspace(0.5, 0.95, np.round((0.95 - 0.5) / 0.05) + 1, endpoint=True) + self.recThrs = np.linspace(0.0, 1.00, np.round((1.00 - 0.0) / 0.01) + 1, endpoint=True) + self.maxDets = [20] + self.areaRng = [[0 ** 2, 1e5 ** 2], [32 ** 2, 96 ** 2], [96 ** 2, 1e5 ** 2]] + self.areaRngLbl = ["all", "medium", "large"] + self.useCats = 1 + + def setUvParams(self): + self.imgIds = [] + self.catIds = [] + self.iouThrs = np.linspace(0.5, 0.95, int(np.round((0.95 - 0.5) / 0.05)) + 1, endpoint=True) + self.recThrs = np.linspace(0.0, 1.00, int(np.round((1.00 - 0.0) / 0.01)) + 1, endpoint=True) + self.maxDets = [20] + self.areaRng = [[0 ** 2, 1e5 ** 2], [32 ** 2, 96 ** 2], [96 ** 2, 1e5 ** 2]] + self.areaRngLbl = ["all", "medium", "large"] + self.useCats = 1 + + def __init__(self, iouType="segm"): + if iouType == "segm" or iouType == "bbox": + self.setDetParams() + elif iouType == "keypoints": + self.setKpParams() + elif iouType == "densepose": + self.setUvParams() + else: + raise Exception("iouType not supported") + self.iouType = iouType + # useSegm is deprecated + self.useSegm = None diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/densepose/densepose_head.py b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/densepose/densepose_head.py new file mode 100644 index 0000000000000000000000000000000000000000..d5fb7167365ad6147ef93e3a92e38aa26fd42523 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/densepose/densepose_head.py @@ -0,0 +1,1216 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +import math +from dataclasses import dataclass +from enum import Enum +import fvcore.nn.weight_init as weight_init +import torch +from torch import nn +from torch.nn import functional as F + +from detectron2.config import CfgNode +from detectron2.layers import Conv2d, ConvTranspose2d, interpolate +from detectron2.structures.boxes import matched_boxlist_iou +from detectron2.utils.registry import Registry + +from .data.structures import DensePoseOutput + +ROI_DENSEPOSE_HEAD_REGISTRY = Registry("ROI_DENSEPOSE_HEAD") + + +class DensePoseUVConfidenceType(Enum): + """ + Statistical model type for confidence learning, possible values: + - "iid_iso": statistically independent identically distributed residuals + with anisotropic covariance + - "indep_aniso": statistically independent residuals with anisotropic + covariances + For details, see: + N. Neverova, D. Novotny, A. Vedaldi "Correlated Uncertainty for Learning + Dense Correspondences from Noisy Labels", p. 918--926, in Proc. NIPS 2019 + """ + + # fmt: off + IID_ISO = "iid_iso" + INDEP_ANISO = "indep_aniso" + # fmt: on + + +@dataclass +class DensePoseUVConfidenceConfig: + """ + Configuration options for confidence on UV data + """ + + enabled: bool = False + # lower bound on UV confidences + epsilon: float = 0.01 + type: DensePoseUVConfidenceType = DensePoseUVConfidenceType.IID_ISO + + +@dataclass +class DensePoseConfidenceModelConfig: + """ + Configuration options for confidence models + """ + + # confidence for U and V values + uv_confidence: DensePoseUVConfidenceConfig + + @staticmethod + def from_cfg(cfg: CfgNode) -> "DensePoseConfidenceModelConfig": + return DensePoseConfidenceModelConfig( + uv_confidence=DensePoseUVConfidenceConfig( + enabled=cfg.MODEL.ROI_DENSEPOSE_HEAD.UV_CONFIDENCE.ENABLED, + epsilon=cfg.MODEL.ROI_DENSEPOSE_HEAD.UV_CONFIDENCE.EPSILON, + type=DensePoseUVConfidenceType(cfg.MODEL.ROI_DENSEPOSE_HEAD.UV_CONFIDENCE.TYPE), + ) + ) + + +def initialize_module_params(module): + for name, param in module.named_parameters(): + if "bias" in name: + nn.init.constant_(param, 0) + elif "weight" in name: + nn.init.kaiming_normal_(param, mode="fan_out", nonlinearity="relu") + + +@ROI_DENSEPOSE_HEAD_REGISTRY.register() +class DensePoseDeepLabHead(nn.Module): + def __init__(self, cfg, input_channels): + super(DensePoseDeepLabHead, self).__init__() + # fmt: off + hidden_dim = cfg.MODEL.ROI_DENSEPOSE_HEAD.CONV_HEAD_DIM + kernel_size = cfg.MODEL.ROI_DENSEPOSE_HEAD.CONV_HEAD_KERNEL + norm = cfg.MODEL.ROI_DENSEPOSE_HEAD.DEEPLAB.NORM + self.n_stacked_convs = cfg.MODEL.ROI_DENSEPOSE_HEAD.NUM_STACKED_CONVS + self.use_nonlocal = cfg.MODEL.ROI_DENSEPOSE_HEAD.DEEPLAB.NONLOCAL_ON + # fmt: on + pad_size = kernel_size // 2 + n_channels = input_channels + + self.ASPP = ASPP(input_channels, [6, 12, 56], n_channels) # 6, 12, 56 + self.add_module("ASPP", self.ASPP) + + if self.use_nonlocal: + self.NLBlock = NONLocalBlock2D(input_channels, bn_layer=True) + self.add_module("NLBlock", self.NLBlock) + # weight_init.c2_msra_fill(self.ASPP) + + for i in range(self.n_stacked_convs): + norm_module = nn.GroupNorm(32, hidden_dim) if norm == "GN" else None + layer = Conv2d( + n_channels, + hidden_dim, + kernel_size, + stride=1, + padding=pad_size, + bias=not norm, + norm=norm_module, + ) + weight_init.c2_msra_fill(layer) + n_channels = hidden_dim + layer_name = self._get_layer_name(i) + self.add_module(layer_name, layer) + self.n_out_channels = hidden_dim + # initialize_module_params(self) + + def forward(self, features): + x0 = features + x = self.ASPP(x0) + if self.use_nonlocal: + x = self.NLBlock(x) + output = x + for i in range(self.n_stacked_convs): + layer_name = self._get_layer_name(i) + x = getattr(self, layer_name)(x) + x = F.relu(x) + output = x + return output + + def _get_layer_name(self, i): + layer_name = "body_conv_fcn{}".format(i + 1) + return layer_name + + +# Copied from +# https://github.com/pytorch/vision/blob/master/torchvision/models/segmentation/deeplabv3.py +# See https://arxiv.org/pdf/1706.05587.pdf for details +class ASPPConv(nn.Sequential): + def __init__(self, in_channels, out_channels, dilation): + modules = [ + nn.Conv2d( + in_channels, out_channels, 3, padding=dilation, dilation=dilation, bias=False + ), + nn.GroupNorm(32, out_channels), + nn.ReLU(), + ] + super(ASPPConv, self).__init__(*modules) + + +class ASPPPooling(nn.Sequential): + def __init__(self, in_channels, out_channels): + super(ASPPPooling, self).__init__( + nn.AdaptiveAvgPool2d(1), + nn.Conv2d(in_channels, out_channels, 1, bias=False), + nn.GroupNorm(32, out_channels), + nn.ReLU(), + ) + + def forward(self, x): + size = x.shape[-2:] + x = super(ASPPPooling, self).forward(x) + return F.interpolate(x, size=size, mode="bilinear", align_corners=False) + + +class ASPP(nn.Module): + def __init__(self, in_channels, atrous_rates, out_channels): + super(ASPP, self).__init__() + modules = [] + modules.append( + nn.Sequential( + nn.Conv2d(in_channels, out_channels, 1, bias=False), + nn.GroupNorm(32, out_channels), + nn.ReLU(), + ) + ) + + rate1, rate2, rate3 = tuple(atrous_rates) + modules.append(ASPPConv(in_channels, out_channels, rate1)) + modules.append(ASPPConv(in_channels, out_channels, rate2)) + modules.append(ASPPConv(in_channels, out_channels, rate3)) + modules.append(ASPPPooling(in_channels, out_channels)) + + self.convs = nn.ModuleList(modules) + + self.project = nn.Sequential( + nn.Conv2d(5 * out_channels, out_channels, 1, bias=False), + # nn.BatchNorm2d(out_channels), + nn.ReLU() + # nn.Dropout(0.5) + ) + + def forward(self, x): + res = [] + for conv in self.convs: + res.append(conv(x)) + res = torch.cat(res, dim=1) + return self.project(res) + + +# copied from +# https://github.com/AlexHex7/Non-local_pytorch/blob/master/lib/non_local_embedded_gaussian.py +# See https://arxiv.org/abs/1711.07971 for details +class _NonLocalBlockND(nn.Module): + def __init__( + self, in_channels, inter_channels=None, dimension=3, sub_sample=True, bn_layer=True + ): + super(_NonLocalBlockND, self).__init__() + + assert dimension in [1, 2, 3] + + self.dimension = dimension + self.sub_sample = sub_sample + + self.in_channels = in_channels + self.inter_channels = inter_channels + + if self.inter_channels is None: + self.inter_channels = in_channels // 2 + if self.inter_channels == 0: + self.inter_channels = 1 + + if dimension == 3: + conv_nd = nn.Conv3d + max_pool_layer = nn.MaxPool3d(kernel_size=(1, 2, 2)) + bn = nn.GroupNorm # (32, hidden_dim) #nn.BatchNorm3d + elif dimension == 2: + conv_nd = nn.Conv2d + max_pool_layer = nn.MaxPool2d(kernel_size=(2, 2)) + bn = nn.GroupNorm # (32, hidden_dim)nn.BatchNorm2d + else: + conv_nd = nn.Conv1d + max_pool_layer = nn.MaxPool1d(kernel_size=2) + bn = nn.GroupNorm # (32, hidden_dim)nn.BatchNorm1d + + self.g = conv_nd( + in_channels=self.in_channels, + out_channels=self.inter_channels, + kernel_size=1, + stride=1, + padding=0, + ) + + if bn_layer: + self.W = nn.Sequential( + conv_nd( + in_channels=self.inter_channels, + out_channels=self.in_channels, + kernel_size=1, + stride=1, + padding=0, + ), + bn(32, self.in_channels), + ) + nn.init.constant_(self.W[1].weight, 0) + nn.init.constant_(self.W[1].bias, 0) + else: + self.W = conv_nd( + in_channels=self.inter_channels, + out_channels=self.in_channels, + kernel_size=1, + stride=1, + padding=0, + ) + nn.init.constant_(self.W.weight, 0) + nn.init.constant_(self.W.bias, 0) + + self.theta = conv_nd( + in_channels=self.in_channels, + out_channels=self.inter_channels, + kernel_size=1, + stride=1, + padding=0, + ) + self.phi = conv_nd( + in_channels=self.in_channels, + out_channels=self.inter_channels, + kernel_size=1, + stride=1, + padding=0, + ) + + if sub_sample: + self.g = nn.Sequential(self.g, max_pool_layer) + self.phi = nn.Sequential(self.phi, max_pool_layer) + + def forward(self, x): + """ + :param x: (b, c, t, h, w) + :return: + """ + + batch_size = x.size(0) + + g_x = self.g(x).view(batch_size, self.inter_channels, -1) + g_x = g_x.permute(0, 2, 1) + + theta_x = self.theta(x).view(batch_size, self.inter_channels, -1) + theta_x = theta_x.permute(0, 2, 1) + phi_x = self.phi(x).view(batch_size, self.inter_channels, -1) + f = torch.matmul(theta_x, phi_x) + f_div_C = F.softmax(f, dim=-1) + + y = torch.matmul(f_div_C, g_x) + y = y.permute(0, 2, 1).contiguous() + y = y.view(batch_size, self.inter_channels, *x.size()[2:]) + W_y = self.W(y) + z = W_y + x + + return z + + +class NONLocalBlock2D(_NonLocalBlockND): + def __init__(self, in_channels, inter_channels=None, sub_sample=True, bn_layer=True): + super(NONLocalBlock2D, self).__init__( + in_channels, + inter_channels=inter_channels, + dimension=2, + sub_sample=sub_sample, + bn_layer=bn_layer, + ) + + +@ROI_DENSEPOSE_HEAD_REGISTRY.register() +class DensePoseV1ConvXHead(nn.Module): + def __init__(self, cfg, input_channels): + super(DensePoseV1ConvXHead, self).__init__() + # fmt: off + hidden_dim = cfg.MODEL.ROI_DENSEPOSE_HEAD.CONV_HEAD_DIM + kernel_size = cfg.MODEL.ROI_DENSEPOSE_HEAD.CONV_HEAD_KERNEL + self.n_stacked_convs = cfg.MODEL.ROI_DENSEPOSE_HEAD.NUM_STACKED_CONVS + # fmt: on + pad_size = kernel_size // 2 + n_channels = input_channels + for i in range(self.n_stacked_convs): + layer = Conv2d(n_channels, hidden_dim, kernel_size, stride=1, padding=pad_size) + layer_name = self._get_layer_name(i) + self.add_module(layer_name, layer) + n_channels = hidden_dim + self.n_out_channels = n_channels + initialize_module_params(self) + + def forward(self, features): + x = features + output = x + for i in range(self.n_stacked_convs): + layer_name = self._get_layer_name(i) + x = getattr(self, layer_name)(x) + x = F.relu(x) + output = x + return output + + def _get_layer_name(self, i): + layer_name = "body_conv_fcn{}".format(i + 1) + return layer_name + + +class DensePosePredictor(nn.Module): + def __init__(self, cfg, input_channels): + + super(DensePosePredictor, self).__init__() + dim_in = input_channels + n_segm_chan = cfg.MODEL.ROI_DENSEPOSE_HEAD.NUM_COARSE_SEGM_CHANNELS + dim_out_patches = cfg.MODEL.ROI_DENSEPOSE_HEAD.NUM_PATCHES + 1 + kernel_size = cfg.MODEL.ROI_DENSEPOSE_HEAD.DECONV_KERNEL + self.ann_index_lowres = ConvTranspose2d( + dim_in, n_segm_chan, kernel_size, stride=2, padding=int(kernel_size / 2 - 1) + ) + self.index_uv_lowres = ConvTranspose2d( + dim_in, dim_out_patches, kernel_size, stride=2, padding=int(kernel_size / 2 - 1) + ) + self.u_lowres = ConvTranspose2d( + dim_in, dim_out_patches, kernel_size, stride=2, padding=int(kernel_size / 2 - 1) + ) + self.v_lowres = ConvTranspose2d( + dim_in, dim_out_patches, kernel_size, stride=2, padding=int(kernel_size / 2 - 1) + ) + self.scale_factor = cfg.MODEL.ROI_DENSEPOSE_HEAD.UP_SCALE + self.confidence_model_cfg = DensePoseConfidenceModelConfig.from_cfg(cfg) + self._initialize_confidence_estimation_layers(cfg, self.confidence_model_cfg, dim_in) + initialize_module_params(self) + + def forward(self, head_outputs): + ann_index_lowres = self.ann_index_lowres(head_outputs) + index_uv_lowres = self.index_uv_lowres(head_outputs) + u_lowres = self.u_lowres(head_outputs) + v_lowres = self.v_lowres(head_outputs) + + def interp2d(input): + return interpolate( + input, scale_factor=self.scale_factor, mode="bilinear", align_corners=False + ) + + ann_index = interp2d(ann_index_lowres) + index_uv = interp2d(index_uv_lowres) + u = interp2d(u_lowres) + v = interp2d(v_lowres) + ( + (sigma_1, sigma_2, kappa_u, kappa_v), + (sigma_1_lowres, sigma_2_lowres, kappa_u_lowres, kappa_v_lowres), + (ann_index, index_uv), + ) = self._forward_confidence_estimation_layers( + self.confidence_model_cfg, head_outputs, interp2d, ann_index, index_uv + ) + return ( + (ann_index, index_uv, u, v), + (ann_index_lowres, index_uv_lowres, u_lowres, v_lowres), + (sigma_1, sigma_2, kappa_u, kappa_v), + (sigma_1_lowres, sigma_2_lowres, kappa_u_lowres, kappa_v_lowres), + ) + + def _initialize_confidence_estimation_layers( + self, cfg: CfgNode, confidence_model_cfg: DensePoseConfidenceModelConfig, dim_in: int + ): + dim_out_patches = cfg.MODEL.ROI_DENSEPOSE_HEAD.NUM_PATCHES + 1 + kernel_size = cfg.MODEL.ROI_DENSEPOSE_HEAD.DECONV_KERNEL + if confidence_model_cfg.uv_confidence.enabled: + if confidence_model_cfg.uv_confidence.type == DensePoseUVConfidenceType.IID_ISO: + self.sigma_2_lowres = ConvTranspose2d( + dim_in, dim_out_patches, kernel_size, stride=2, padding=int(kernel_size / 2 - 1) + ) + elif confidence_model_cfg.uv_confidence.type == DensePoseUVConfidenceType.INDEP_ANISO: + self.sigma_2_lowres = ConvTranspose2d( + dim_in, dim_out_patches, kernel_size, stride=2, padding=int(kernel_size / 2 - 1) + ) + self.kappa_u_lowres = ConvTranspose2d( + dim_in, dim_out_patches, kernel_size, stride=2, padding=int(kernel_size / 2 - 1) + ) + self.kappa_v_lowres = ConvTranspose2d( + dim_in, dim_out_patches, kernel_size, stride=2, padding=int(kernel_size / 2 - 1) + ) + else: + raise ValueError( + f"Unknown confidence model type: {confidence_model_cfg.confidence_model_type}" + ) + + def _forward_confidence_estimation_layers( + self, confidence_model_cfg, head_outputs, interp2d, ann_index, index_uv + ): + sigma_1, sigma_2, kappa_u, kappa_v = None, None, None, None + sigma_1_lowres, sigma_2_lowres, kappa_u_lowres, kappa_v_lowres = None, None, None, None + if confidence_model_cfg.uv_confidence.enabled: + if confidence_model_cfg.uv_confidence.type == DensePoseUVConfidenceType.IID_ISO: + sigma_2_lowres = self.sigma_2_lowres(head_outputs) + sigma_2 = interp2d(sigma_2_lowres) + elif confidence_model_cfg.uv_confidence.type == DensePoseUVConfidenceType.INDEP_ANISO: + sigma_2_lowres = self.sigma_2_lowres(head_outputs) + kappa_u_lowres = self.kappa_u_lowres(head_outputs) + kappa_v_lowres = self.kappa_v_lowres(head_outputs) + sigma_2 = interp2d(sigma_2_lowres) + kappa_u = interp2d(kappa_u_lowres) + kappa_v = interp2d(kappa_v_lowres) + else: + raise ValueError( + f"Unknown confidence model type: {confidence_model_cfg.confidence_model_type}" + ) + return ( + (sigma_1, sigma_2, kappa_u, kappa_v), + (sigma_1_lowres, sigma_2_lowres, kappa_u_lowres, kappa_v_lowres), + (ann_index, index_uv), + ) + + +class DensePoseDataFilter(object): + def __init__(self, cfg): + self.iou_threshold = cfg.MODEL.ROI_DENSEPOSE_HEAD.FG_IOU_THRESHOLD + + @torch.no_grad() + def __call__(self, proposals_with_targets): + """ + Filters proposals with targets to keep only the ones relevant for + DensePose training + proposals: list(Instances), each element of the list corresponds to + various instances (proposals, GT for boxes and densepose) for one + image + """ + proposals_filtered = [] + for proposals_per_image in proposals_with_targets: + if not hasattr(proposals_per_image, "gt_densepose"): + continue + assert hasattr(proposals_per_image, "gt_boxes") + assert hasattr(proposals_per_image, "proposal_boxes") + gt_boxes = proposals_per_image.gt_boxes + est_boxes = proposals_per_image.proposal_boxes + # apply match threshold for densepose head + iou = matched_boxlist_iou(gt_boxes, est_boxes) + iou_select = iou > self.iou_threshold + proposals_per_image = proposals_per_image[iou_select] + assert len(proposals_per_image.gt_boxes) == len(proposals_per_image.proposal_boxes) + # filter out any target without densepose annotation + gt_densepose = proposals_per_image.gt_densepose + assert len(proposals_per_image.gt_boxes) == len(proposals_per_image.gt_densepose) + selected_indices = [ + i for i, dp_target in enumerate(gt_densepose) if dp_target is not None + ] + if len(selected_indices) != len(gt_densepose): + proposals_per_image = proposals_per_image[selected_indices] + assert len(proposals_per_image.gt_boxes) == len(proposals_per_image.proposal_boxes) + assert len(proposals_per_image.gt_boxes) == len(proposals_per_image.gt_densepose) + proposals_filtered.append(proposals_per_image) + return proposals_filtered + + +def build_densepose_head(cfg, input_channels): + head_name = cfg.MODEL.ROI_DENSEPOSE_HEAD.NAME + return ROI_DENSEPOSE_HEAD_REGISTRY.get(head_name)(cfg, input_channels) + + +def build_densepose_predictor(cfg, input_channels): + predictor = DensePosePredictor(cfg, input_channels) + return predictor + + +def build_densepose_data_filter(cfg): + dp_filter = DensePoseDataFilter(cfg) + return dp_filter + + +def densepose_inference(densepose_outputs, densepose_confidences, detections): + """ + Infer dense pose estimate based on outputs from the DensePose head + and detections. The estimate for each detection instance is stored in its + "pred_densepose" attribute. + + Args: + densepose_outputs (tuple(`torch.Tensor`)): iterable containing 4 elements: + - s (:obj: `torch.Tensor`): coarse segmentation tensor of size (N, A, H, W), + - i (:obj: `torch.Tensor`): fine segmentation tensor of size (N, C, H, W), + - u (:obj: `torch.Tensor`): U coordinates for each class of size (N, C, H, W), + - v (:obj: `torch.Tensor`): V coordinates for each class of size (N, C, H, W), + where N is the total number of detections in a batch, + A is the number of coarse segmentations labels + (e.g. 15 for coarse body parts + background), + C is the number of fine segmentation labels + (e.g. 25 for fine body parts + background), + W is the resolution along the X axis + H is the resolution along the Y axis + densepose_confidences (tuple(`torch.Tensor`)): iterable containing 4 elements: + - sigma_1 (:obj: `torch.Tensor`): global confidences for UV coordinates + of size (N, C, H, W) + - sigma_2 (:obj: `torch.Tensor`): individual confidences for UV coordinates + of size (N, C, H, W) + - kappa_u (:obj: `torch.Tensor`): first component of confidence direction + vector of size (N, C, H, W) + - kappa_v (:obj: `torch.Tensor`): second component of confidence direction + vector of size (N, C, H, W) + detections (list[Instances]): A list of N Instances, where N is the number of images + in the batch. Instances are modified by this method: "pred_densepose" attribute + is added to each instance, the attribute contains the corresponding + DensePoseOutput object. + """ + # DensePose outputs: segmentation, body part indices, U, V + s, index_uv, u, v = densepose_outputs + sigma_1, sigma_2, kappa_u, kappa_v = densepose_confidences + k = 0 + for detection in detections: + n_i = len(detection) + s_i = s[k : k + n_i] + index_uv_i = index_uv[k : k + n_i] + u_i = u[k : k + n_i] + v_i = v[k : k + n_i] + _local_vars = locals() + confidences = { + name: _local_vars[name] + for name in ("sigma_1", "sigma_2", "kappa_u", "kappa_v") + if _local_vars.get(name) is not None + } + densepose_output_i = DensePoseOutput(s_i, index_uv_i, u_i, v_i, confidences) + detection.pred_densepose = densepose_output_i + k += n_i + + +def _linear_interpolation_utilities(v_norm, v0_src, size_src, v0_dst, size_dst, size_z): + """ + Computes utility values for linear interpolation at points v. + The points are given as normalized offsets in the source interval + (v0_src, v0_src + size_src), more precisely: + v = v0_src + v_norm * size_src / 256.0 + The computed utilities include lower points v_lo, upper points v_hi, + interpolation weights v_w and flags j_valid indicating whether the + points falls into the destination interval (v0_dst, v0_dst + size_dst). + + Args: + v_norm (:obj: `torch.Tensor`): tensor of size N containing + normalized point offsets + v0_src (:obj: `torch.Tensor`): tensor of size N containing + left bounds of source intervals for normalized points + size_src (:obj: `torch.Tensor`): tensor of size N containing + source interval sizes for normalized points + v0_dst (:obj: `torch.Tensor`): tensor of size N containing + left bounds of destination intervals + size_dst (:obj: `torch.Tensor`): tensor of size N containing + destination interval sizes + size_z (int): interval size for data to be interpolated + + Returns: + v_lo (:obj: `torch.Tensor`): int tensor of size N containing + indices of lower values used for interpolation, all values are + integers from [0, size_z - 1] + v_hi (:obj: `torch.Tensor`): int tensor of size N containing + indices of upper values used for interpolation, all values are + integers from [0, size_z - 1] + v_w (:obj: `torch.Tensor`): float tensor of size N containing + interpolation weights + j_valid (:obj: `torch.Tensor`): uint8 tensor of size N containing + 0 for points outside the estimation interval + (v0_est, v0_est + size_est) and 1 otherwise + """ + v = v0_src + v_norm * size_src / 256.0 + j_valid = (v - v0_dst >= 0) * (v - v0_dst < size_dst) + v_grid = (v - v0_dst) * size_z / size_dst + v_lo = v_grid.floor().long().clamp(min=0, max=size_z - 1) + v_hi = (v_lo + 1).clamp(max=size_z - 1) + v_grid = torch.min(v_hi.float(), v_grid) + v_w = v_grid - v_lo.float() + return v_lo, v_hi, v_w, j_valid + + +def _grid_sampling_utilities( + zh, zw, bbox_xywh_est, bbox_xywh_gt, index_gt, x_norm, y_norm, index_bbox +): + """ + Prepare tensors used in grid sampling. + + Args: + z_est (:obj: `torch.Tensor`): tensor of size (N,C,H,W) with estimated + values of Z to be extracted for the points X, Y and channel + indices I + bbox_xywh_est (:obj: `torch.Tensor`): tensor of size (N, 4) containing + estimated bounding boxes in format XYWH + bbox_xywh_gt (:obj: `torch.Tensor`): tensor of size (N, 4) containing + matched ground truth bounding boxes in format XYWH + index_gt (:obj: `torch.Tensor`): tensor of size K with point labels for + ground truth points + x_norm (:obj: `torch.Tensor`): tensor of size K with X normalized + coordinates of ground truth points. Image X coordinates can be + obtained as X = Xbbox + x_norm * Wbbox / 255 + y_norm (:obj: `torch.Tensor`): tensor of size K with Y normalized + coordinates of ground truth points. Image Y coordinates can be + obtained as Y = Ybbox + y_norm * Hbbox / 255 + index_bbox (:obj: `torch.Tensor`): tensor of size K with bounding box + indices for each ground truth point. The values are thus in + [0, N-1] + + Returns: + j_valid (:obj: `torch.Tensor`): uint8 tensor of size M containing + 0 for points to be discarded and 1 for points to be selected + y_lo (:obj: `torch.Tensor`): int tensor of indices of upper values + in z_est for each point + y_hi (:obj: `torch.Tensor`): int tensor of indices of lower values + in z_est for each point + x_lo (:obj: `torch.Tensor`): int tensor of indices of left values + in z_est for each point + x_hi (:obj: `torch.Tensor`): int tensor of indices of right values + in z_est for each point + w_ylo_xlo (:obj: `torch.Tensor`): float tensor of size M; + contains upper-left value weight for each point + w_ylo_xhi (:obj: `torch.Tensor`): float tensor of size M; + contains upper-right value weight for each point + w_yhi_xlo (:obj: `torch.Tensor`): float tensor of size M; + contains lower-left value weight for each point + w_yhi_xhi (:obj: `torch.Tensor`): float tensor of size M; + contains lower-right value weight for each point + """ + + x0_gt, y0_gt, w_gt, h_gt = bbox_xywh_gt[index_bbox].unbind(dim=1) + x0_est, y0_est, w_est, h_est = bbox_xywh_est[index_bbox].unbind(dim=1) + x_lo, x_hi, x_w, jx_valid = _linear_interpolation_utilities( + x_norm, x0_gt, w_gt, x0_est, w_est, zw + ) + y_lo, y_hi, y_w, jy_valid = _linear_interpolation_utilities( + y_norm, y0_gt, h_gt, y0_est, h_est, zh + ) + j_valid = jx_valid * jy_valid + + w_ylo_xlo = (1.0 - x_w) * (1.0 - y_w) + w_ylo_xhi = x_w * (1.0 - y_w) + w_yhi_xlo = (1.0 - x_w) * y_w + w_yhi_xhi = x_w * y_w + + return j_valid, y_lo, y_hi, x_lo, x_hi, w_ylo_xlo, w_ylo_xhi, w_yhi_xlo, w_yhi_xhi + + +def _extract_at_points_packed( + z_est, + index_bbox_valid, + slice_index_uv, + y_lo, + y_hi, + x_lo, + x_hi, + w_ylo_xlo, + w_ylo_xhi, + w_yhi_xlo, + w_yhi_xhi, +): + """ + Extract ground truth values z_gt for valid point indices and estimated + values z_est using bilinear interpolation over top-left (y_lo, x_lo), + top-right (y_lo, x_hi), bottom-left (y_hi, x_lo) and bottom-right + (y_hi, x_hi) values in z_est with corresponding weights: + w_ylo_xlo, w_ylo_xhi, w_yhi_xlo and w_yhi_xhi. + Use slice_index_uv to slice dim=1 in z_est + """ + z_est_sampled = ( + z_est[index_bbox_valid, slice_index_uv, y_lo, x_lo] * w_ylo_xlo + + z_est[index_bbox_valid, slice_index_uv, y_lo, x_hi] * w_ylo_xhi + + z_est[index_bbox_valid, slice_index_uv, y_hi, x_lo] * w_yhi_xlo + + z_est[index_bbox_valid, slice_index_uv, y_hi, x_hi] * w_yhi_xhi + ) + return z_est_sampled + + +def _resample_data( + z, bbox_xywh_src, bbox_xywh_dst, wout, hout, mode="nearest", padding_mode="zeros" +): + """ + Args: + z (:obj: `torch.Tensor`): tensor of size (N,C,H,W) with data to be + resampled + bbox_xywh_src (:obj: `torch.Tensor`): tensor of size (N,4) containing + source bounding boxes in format XYWH + bbox_xywh_dst (:obj: `torch.Tensor`): tensor of size (N,4) containing + destination bounding boxes in format XYWH + Return: + zresampled (:obj: `torch.Tensor`): tensor of size (N, C, Hout, Wout) + with resampled values of z, where D is the discretization size + """ + n = bbox_xywh_src.size(0) + assert n == bbox_xywh_dst.size(0), ( + "The number of " + "source ROIs for resampling ({}) should be equal to the number " + "of destination ROIs ({})".format(bbox_xywh_src.size(0), bbox_xywh_dst.size(0)) + ) + x0src, y0src, wsrc, hsrc = bbox_xywh_src.unbind(dim=1) + x0dst, y0dst, wdst, hdst = bbox_xywh_dst.unbind(dim=1) + x0dst_norm = 2 * (x0dst - x0src) / wsrc - 1 + y0dst_norm = 2 * (y0dst - y0src) / hsrc - 1 + x1dst_norm = 2 * (x0dst + wdst - x0src) / wsrc - 1 + y1dst_norm = 2 * (y0dst + hdst - y0src) / hsrc - 1 + grid_w = torch.arange(wout, device=z.device, dtype=torch.float) / wout + grid_h = torch.arange(hout, device=z.device, dtype=torch.float) / hout + grid_w_expanded = grid_w[None, None, :].expand(n, hout, wout) + grid_h_expanded = grid_h[None, :, None].expand(n, hout, wout) + dx_expanded = (x1dst_norm - x0dst_norm)[:, None, None].expand(n, hout, wout) + dy_expanded = (y1dst_norm - y0dst_norm)[:, None, None].expand(n, hout, wout) + x0_expanded = x0dst_norm[:, None, None].expand(n, hout, wout) + y0_expanded = y0dst_norm[:, None, None].expand(n, hout, wout) + grid_x = grid_w_expanded * dx_expanded + x0_expanded + grid_y = grid_h_expanded * dy_expanded + y0_expanded + grid = torch.stack((grid_x, grid_y), dim=3) + # resample Z from (N, C, H, W) into (N, C, Hout, Wout) + zresampled = F.grid_sample(z, grid, mode=mode, padding_mode=padding_mode, align_corners=True) + return zresampled + + +def _extract_single_tensors_from_matches_one_image( + proposals_targets, bbox_with_dp_offset, bbox_global_offset +): + i_gt_all = [] + x_norm_all = [] + y_norm_all = [] + u_gt_all = [] + v_gt_all = [] + s_gt_all = [] + bbox_xywh_gt_all = [] + bbox_xywh_est_all = [] + # Ibbox_all == k should be true for all data that corresponds + # to bbox_xywh_gt[k] and bbox_xywh_est[k] + # index k here is global wrt images + i_bbox_all = [] + # at offset k (k is global) contains index of bounding box data + # within densepose output tensor + i_with_dp = [] + + boxes_xywh_est = proposals_targets.proposal_boxes.clone() + boxes_xywh_gt = proposals_targets.gt_boxes.clone() + n_i = len(boxes_xywh_est) + assert n_i == len(boxes_xywh_gt) + + if n_i: + boxes_xywh_est.tensor[:, 2] -= boxes_xywh_est.tensor[:, 0] + boxes_xywh_est.tensor[:, 3] -= boxes_xywh_est.tensor[:, 1] + boxes_xywh_gt.tensor[:, 2] -= boxes_xywh_gt.tensor[:, 0] + boxes_xywh_gt.tensor[:, 3] -= boxes_xywh_gt.tensor[:, 1] + if hasattr(proposals_targets, "gt_densepose"): + densepose_gt = proposals_targets.gt_densepose + for k, box_xywh_est, box_xywh_gt, dp_gt in zip( + range(n_i), boxes_xywh_est.tensor, boxes_xywh_gt.tensor, densepose_gt + ): + if (dp_gt is not None) and (len(dp_gt.x) > 0): + i_gt_all.append(dp_gt.i) + x_norm_all.append(dp_gt.x) + y_norm_all.append(dp_gt.y) + u_gt_all.append(dp_gt.u) + v_gt_all.append(dp_gt.v) + s_gt_all.append(dp_gt.segm.unsqueeze(0)) + bbox_xywh_gt_all.append(box_xywh_gt.view(-1, 4)) + bbox_xywh_est_all.append(box_xywh_est.view(-1, 4)) + i_bbox_k = torch.full_like(dp_gt.i, bbox_with_dp_offset + len(i_with_dp)) + i_bbox_all.append(i_bbox_k) + i_with_dp.append(bbox_global_offset + k) + return ( + i_gt_all, + x_norm_all, + y_norm_all, + u_gt_all, + v_gt_all, + s_gt_all, + bbox_xywh_gt_all, + bbox_xywh_est_all, + i_bbox_all, + i_with_dp, + ) + + +def _extract_single_tensors_from_matches(proposals_with_targets): + i_img = [] + i_gt_all = [] + x_norm_all = [] + y_norm_all = [] + u_gt_all = [] + v_gt_all = [] + s_gt_all = [] + bbox_xywh_gt_all = [] + bbox_xywh_est_all = [] + i_bbox_all = [] + i_with_dp_all = [] + n = 0 + for i, proposals_targets_per_image in enumerate(proposals_with_targets): + n_i = proposals_targets_per_image.proposal_boxes.tensor.size(0) + if not n_i: + continue + ( + i_gt_img, + x_norm_img, + y_norm_img, + u_gt_img, + v_gt_img, + s_gt_img, + bbox_xywh_gt_img, + bbox_xywh_est_img, + i_bbox_img, + i_with_dp_img, + ) = _extract_single_tensors_from_matches_one_image( # noqa + proposals_targets_per_image, len(i_with_dp_all), n + ) + i_gt_all.extend(i_gt_img) + x_norm_all.extend(x_norm_img) + y_norm_all.extend(y_norm_img) + u_gt_all.extend(u_gt_img) + v_gt_all.extend(v_gt_img) + s_gt_all.extend(s_gt_img) + bbox_xywh_gt_all.extend(bbox_xywh_gt_img) + bbox_xywh_est_all.extend(bbox_xywh_est_img) + i_bbox_all.extend(i_bbox_img) + i_with_dp_all.extend(i_with_dp_img) + i_img.extend([i] * len(i_with_dp_img)) + n += n_i + # concatenate all data into a single tensor + if (n > 0) and (len(i_with_dp_all) > 0): + i_gt = torch.cat(i_gt_all, 0).long() + x_norm = torch.cat(x_norm_all, 0) + y_norm = torch.cat(y_norm_all, 0) + u_gt = torch.cat(u_gt_all, 0) + v_gt = torch.cat(v_gt_all, 0) + s_gt = torch.cat(s_gt_all, 0) + bbox_xywh_gt = torch.cat(bbox_xywh_gt_all, 0) + bbox_xywh_est = torch.cat(bbox_xywh_est_all, 0) + i_bbox = torch.cat(i_bbox_all, 0).long() + else: + i_gt = None + x_norm = None + y_norm = None + u_gt = None + v_gt = None + s_gt = None + bbox_xywh_gt = None + bbox_xywh_est = None + i_bbox = None + return ( + i_img, + i_with_dp_all, + bbox_xywh_est, + bbox_xywh_gt, + i_gt, + x_norm, + y_norm, + u_gt, + v_gt, + s_gt, + i_bbox, + ) + + +class IIDIsotropicGaussianUVLoss(nn.Module): + """ + Loss for the case of iid residuals with isotropic covariance: + $Sigma_i = sigma_i^2 I$ + The loss (negative log likelihood) is then: + $1/2 sum_{i=1}^n (log(2 pi) + 2 log sigma_i^2 + ||delta_i||^2 / sigma_i^2)$, + where $delta_i=(u - u', v - v')$ is a 2D vector containing UV coordinates + difference between estimated and ground truth UV values + For details, see: + N. Neverova, D. Novotny, A. Vedaldi "Correlated Uncertainty for Learning + Dense Correspondences from Noisy Labels", p. 918--926, in Proc. NIPS 2019 + """ + + def __init__(self, sigma_lower_bound: float): + super(IIDIsotropicGaussianUVLoss, self).__init__() + self.sigma_lower_bound = sigma_lower_bound + self.log2pi = math.log(2 * math.pi) + + def forward( + self, + u: torch.Tensor, + v: torch.Tensor, + sigma_u: torch.Tensor, + target_u: torch.Tensor, + target_v: torch.Tensor, + ): + # compute $\sigma_i^2$ + # use sigma_lower_bound to avoid degenerate solution for variance + # (sigma -> 0) + sigma2 = F.softplus(sigma_u) + self.sigma_lower_bound + # compute \|delta_i\|^2 + delta_t_delta = (u - target_u) ** 2 + (v - target_v) ** 2 + # the total loss from the formula above: + loss = 0.5 * (self.log2pi + 2 * torch.log(sigma2) + delta_t_delta / sigma2) + return loss.sum() + + +class IndepAnisotropicGaussianUVLoss(nn.Module): + """ + Loss for the case of independent residuals with anisotropic covariances: + $Sigma_i = sigma_i^2 I + r_i r_i^T$ + The loss (negative log likelihood) is then: + $1/2 sum_{i=1}^n (log(2 pi) + + log sigma_i^2 (sigma_i^2 + ||r_i||^2) + + ||delta_i||^2 / sigma_i^2 + - ^2 / (sigma_i^2 * (sigma_i^2 + ||r_i||^2)))$, + where $delta_i=(u - u', v - v')$ is a 2D vector containing UV coordinates + difference between estimated and ground truth UV values + For details, see: + N. Neverova, D. Novotny, A. Vedaldi "Correlated Uncertainty for Learning + Dense Correspondences from Noisy Labels", p. 918--926, in Proc. NIPS 2019 + """ + + def __init__(self, sigma_lower_bound: float): + super(IndepAnisotropicGaussianUVLoss, self).__init__() + self.sigma_lower_bound = sigma_lower_bound + self.log2pi = math.log(2 * math.pi) + + def forward( + self, + u: torch.Tensor, + v: torch.Tensor, + sigma_u: torch.Tensor, + kappa_u_est: torch.Tensor, + kappa_v_est: torch.Tensor, + target_u: torch.Tensor, + target_v: torch.Tensor, + ): + # compute $\sigma_i^2$ + sigma2 = F.softplus(sigma_u) + self.sigma_lower_bound + # compute \|r_i\|^2 + r_sqnorm2 = kappa_u_est ** 2 + kappa_v_est ** 2 + delta_u = u - target_u + delta_v = v - target_v + # compute \|delta_i\|^2 + delta_sqnorm = delta_u ** 2 + delta_v ** 2 + delta_u_r_u = delta_u * kappa_u_est + delta_v_r_v = delta_v * kappa_v_est + # compute the scalar product + delta_r = delta_u_r_u + delta_v_r_v + # compute squared scalar product ^2 + delta_r_sqnorm = delta_r ** 2 + denom2 = sigma2 * (sigma2 + r_sqnorm2) + loss = 0.5 * ( + self.log2pi + torch.log(denom2) + delta_sqnorm / sigma2 - delta_r_sqnorm / denom2 + ) + return loss.sum() + + +class DensePoseLosses(object): + def __init__(self, cfg): + # fmt: off + self.heatmap_size = cfg.MODEL.ROI_DENSEPOSE_HEAD.HEATMAP_SIZE + self.w_points = cfg.MODEL.ROI_DENSEPOSE_HEAD.POINT_REGRESSION_WEIGHTS + self.w_part = cfg.MODEL.ROI_DENSEPOSE_HEAD.PART_WEIGHTS + self.w_segm = cfg.MODEL.ROI_DENSEPOSE_HEAD.INDEX_WEIGHTS + self.n_segm_chan = cfg.MODEL.ROI_DENSEPOSE_HEAD.NUM_COARSE_SEGM_CHANNELS + # fmt: on + self.confidence_model_cfg = DensePoseConfidenceModelConfig.from_cfg(cfg) + if self.confidence_model_cfg.uv_confidence.type == DensePoseUVConfidenceType.IID_ISO: + self.uv_loss_with_confidences = IIDIsotropicGaussianUVLoss( + self.confidence_model_cfg.uv_confidence.epsilon + ) + elif self.confidence_model_cfg.uv_confidence.type == DensePoseUVConfidenceType.INDEP_ANISO: + self.uv_loss_with_confidences = IndepAnisotropicGaussianUVLoss( + self.confidence_model_cfg.uv_confidence.epsilon + ) + + def __call__(self, proposals_with_gt, densepose_outputs, densepose_confidences): + losses = {} + # densepose outputs are computed for all images and all bounding boxes; + # i.e. if a batch has 4 images with (3, 1, 2, 1) proposals respectively, + # the outputs will have size(0) == 3+1+2+1 == 7 + s, index_uv, u, v = densepose_outputs + sigma_1, sigma_2, kappa_u, kappa_v = densepose_confidences + conf_type = self.confidence_model_cfg.uv_confidence.type + assert u.size(2) == v.size(2) + assert u.size(3) == v.size(3) + assert u.size(2) == index_uv.size(2) + assert u.size(3) == index_uv.size(3) + + with torch.no_grad(): + ( + index_uv_img, + i_with_dp, + bbox_xywh_est, + bbox_xywh_gt, + index_gt_all, + x_norm, + y_norm, + u_gt_all, + v_gt_all, + s_gt, + index_bbox, + ) = _extract_single_tensors_from_matches( # noqa + proposals_with_gt + ) + n_batch = len(i_with_dp) + + # NOTE: we need to keep the same computation graph on all the GPUs to + # perform reduction properly. Hence even if we have no data on one + # of the GPUs, we still need to generate the computation graph. + # Add fake (zero) loss in the form Tensor.sum() * 0 + if not n_batch: + losses["loss_densepose_I"] = index_uv.sum() * 0 + losses["loss_densepose_S"] = s.sum() * 0 + if self.confidence_model_cfg.uv_confidence.enabled: + losses["loss_densepose_UV"] = (u.sum() + v.sum()) * 0 + if conf_type == DensePoseUVConfidenceType.IID_ISO: + losses["loss_densepose_UV"] += sigma_2.sum() * 0 + elif conf_type == DensePoseUVConfidenceType.INDEP_ANISO: + losses["loss_densepose_UV"] += ( + sigma_2.sum() + kappa_u.sum() + kappa_v.sum() + ) * 0 + else: + losses["loss_densepose_U"] = u.sum() * 0 + losses["loss_densepose_V"] = v.sum() * 0 + return losses + + zh = u.size(2) + zw = u.size(3) + + ( + j_valid, + y_lo, + y_hi, + x_lo, + x_hi, + w_ylo_xlo, + w_ylo_xhi, + w_yhi_xlo, + w_yhi_xhi, + ) = _grid_sampling_utilities( # noqa + zh, zw, bbox_xywh_est, bbox_xywh_gt, index_gt_all, x_norm, y_norm, index_bbox + ) + + j_valid_fg = j_valid * (index_gt_all > 0) + + u_gt = u_gt_all[j_valid_fg] + u_est_all = _extract_at_points_packed( + u[i_with_dp], + index_bbox, + index_gt_all, + y_lo, + y_hi, + x_lo, + x_hi, + w_ylo_xlo, + w_ylo_xhi, + w_yhi_xlo, + w_yhi_xhi, + ) + u_est = u_est_all[j_valid_fg] + + v_gt = v_gt_all[j_valid_fg] + v_est_all = _extract_at_points_packed( + v[i_with_dp], + index_bbox, + index_gt_all, + y_lo, + y_hi, + x_lo, + x_hi, + w_ylo_xlo, + w_ylo_xhi, + w_yhi_xlo, + w_yhi_xhi, + ) + v_est = v_est_all[j_valid_fg] + + index_uv_gt = index_gt_all[j_valid] + index_uv_est_all = _extract_at_points_packed( + index_uv[i_with_dp], + index_bbox, + slice(None), + y_lo, + y_hi, + x_lo, + x_hi, + w_ylo_xlo[:, None], + w_ylo_xhi[:, None], + w_yhi_xlo[:, None], + w_yhi_xhi[:, None], + ) + index_uv_est = index_uv_est_all[j_valid, :] + + if self.confidence_model_cfg.uv_confidence.enabled: + sigma_2_est_all = _extract_at_points_packed( + sigma_2[i_with_dp], + index_bbox, + index_gt_all, + y_lo, + y_hi, + x_lo, + x_hi, + w_ylo_xlo, + w_ylo_xhi, + w_yhi_xlo, + w_yhi_xhi, + ) + sigma_2_est = sigma_2_est_all[j_valid_fg] + if conf_type in [DensePoseUVConfidenceType.INDEP_ANISO]: + kappa_u_est_all = _extract_at_points_packed( + kappa_u[i_with_dp], + index_bbox, + index_gt_all, + y_lo, + y_hi, + x_lo, + x_hi, + w_ylo_xlo, + w_ylo_xhi, + w_yhi_xlo, + w_yhi_xhi, + ) + kappa_u_est = kappa_u_est_all[j_valid_fg] + kappa_v_est_all = _extract_at_points_packed( + kappa_v[i_with_dp], + index_bbox, + index_gt_all, + y_lo, + y_hi, + x_lo, + x_hi, + w_ylo_xlo, + w_ylo_xhi, + w_yhi_xlo, + w_yhi_xhi, + ) + kappa_v_est = kappa_v_est_all[j_valid_fg] + + # Resample everything to the estimated data size, no need to resample + # S_est then: + s_est = s[i_with_dp] + with torch.no_grad(): + s_gt = _resample_data( + s_gt.unsqueeze(1), + bbox_xywh_gt, + bbox_xywh_est, + self.heatmap_size, + self.heatmap_size, + mode="nearest", + padding_mode="zeros", + ).squeeze(1) + + # add point-based losses: + if self.confidence_model_cfg.uv_confidence.enabled: + if conf_type == DensePoseUVConfidenceType.IID_ISO: + uv_loss = ( + self.uv_loss_with_confidences(u_est, v_est, sigma_2_est, u_gt, v_gt) + * self.w_points + ) + losses["loss_densepose_UV"] = uv_loss + elif conf_type == DensePoseUVConfidenceType.INDEP_ANISO: + uv_loss = ( + self.uv_loss_with_confidences( + u_est, v_est, sigma_2_est, kappa_u_est, kappa_v_est, u_gt, v_gt + ) + * self.w_points + ) + losses["loss_densepose_UV"] = uv_loss + else: + raise ValueError(f"Unknown confidence model type: {conf_type}") + else: + u_loss = F.smooth_l1_loss(u_est, u_gt, reduction="sum") * self.w_points + losses["loss_densepose_U"] = u_loss + v_loss = F.smooth_l1_loss(v_est, v_gt, reduction="sum") * self.w_points + losses["loss_densepose_V"] = v_loss + index_uv_loss = F.cross_entropy(index_uv_est, index_uv_gt.long()) * self.w_part + losses["loss_densepose_I"] = index_uv_loss + + if self.n_segm_chan == 2: + s_gt = s_gt > 0 + s_loss = F.cross_entropy(s_est, s_gt.long()) * self.w_segm + losses["loss_densepose_S"] = s_loss + return losses + + +def build_densepose_losses(cfg): + losses = DensePoseLosses(cfg) + return losses diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/densepose/evaluator.py b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/densepose/evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..15b752a9da2276c42263600a3c10a2eceb7e5ee2 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/densepose/evaluator.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved + +import contextlib +import copy +import io +import itertools +import json +import logging +import os +from collections import OrderedDict +import torch +from fvcore.common.file_io import PathManager +from pycocotools.coco import COCO + +from detectron2.data import MetadataCatalog +from detectron2.evaluation import DatasetEvaluator +from detectron2.structures import BoxMode +from detectron2.utils.comm import all_gather, is_main_process, synchronize +from detectron2.utils.logger import create_small_table + +from .densepose_coco_evaluation import DensePoseCocoEval, DensePoseEvalMode + + +class DensePoseCOCOEvaluator(DatasetEvaluator): + def __init__(self, dataset_name, distributed, output_dir=None): + self._distributed = distributed + self._output_dir = output_dir + + self._cpu_device = torch.device("cpu") + self._logger = logging.getLogger(__name__) + + self._metadata = MetadataCatalog.get(dataset_name) + json_file = PathManager.get_local_path(self._metadata.json_file) + with contextlib.redirect_stdout(io.StringIO()): + self._coco_api = COCO(json_file) + + def reset(self): + self._predictions = [] + + def process(self, inputs, outputs): + """ + Args: + inputs: the inputs to a COCO model (e.g., GeneralizedRCNN). + It is a list of dict. Each dict corresponds to an image and + contains keys like "height", "width", "file_name", "image_id". + outputs: the outputs of a COCO model. It is a list of dicts with key + "instances" that contains :class:`Instances`. + The :class:`Instances` object needs to have `densepose` field. + """ + for input, output in zip(inputs, outputs): + instances = output["instances"].to(self._cpu_device) + + boxes = instances.pred_boxes.tensor.clone() + boxes = BoxMode.convert(boxes, BoxMode.XYXY_ABS, BoxMode.XYWH_ABS) + instances.pred_densepose = instances.pred_densepose.to_result(boxes) + + json_results = prediction_to_json(instances, input["image_id"]) + self._predictions.extend(json_results) + + def evaluate(self): + if self._distributed: + synchronize() + predictions = all_gather(self._predictions) + predictions = list(itertools.chain(*predictions)) + if not is_main_process(): + return + else: + predictions = self._predictions + + return copy.deepcopy(self._eval_predictions(predictions)) + + def _eval_predictions(self, predictions): + """ + Evaluate predictions on densepose. + Return results with the metrics of the tasks. + """ + self._logger.info("Preparing results for COCO format ...") + + if self._output_dir: + file_path = os.path.join(self._output_dir, "coco_densepose_results.json") + with open(file_path, "w") as f: + json.dump(predictions, f) + f.flush() + os.fsync(f.fileno()) + + self._logger.info("Evaluating predictions ...") + res = OrderedDict() + results_gps, results_gpsm = _evaluate_predictions_on_coco(self._coco_api, predictions) + res["densepose_gps"] = results_gps + res["densepose_gpsm"] = results_gpsm + return res + + +def prediction_to_json(instances, img_id): + """ + Args: + instances (Instances): the output of the model + img_id (str): the image id in COCO + + Returns: + list[dict]: the results in densepose evaluation format + """ + scores = instances.scores.tolist() + + results = [] + for k in range(len(instances)): + densepose = instances.pred_densepose[k] + result = { + "image_id": img_id, + "category_id": 1, # densepose only has one class + "bbox": densepose[1], + "score": scores[k], + "densepose": densepose, + } + results.append(result) + return results + + +def _evaluate_predictions_on_coco(coco_gt, coco_results): + metrics = ["AP", "AP50", "AP75", "APm", "APl"] + + logger = logging.getLogger(__name__) + + if len(coco_results) == 0: # cocoapi does not handle empty results very well + logger.warn("No predictions from the model! Set scores to -1") + results_gps = {metric: -1 for metric in metrics} + results_gpsm = {metric: -1 for metric in metrics} + return results_gps, results_gpsm + + coco_dt = coco_gt.loadRes(coco_results) + results_gps = _evaluate_predictions_on_coco_gps(coco_gt, coco_dt, metrics) + logger.info( + "Evaluation results for densepose, GPS metric: \n" + create_small_table(results_gps) + ) + results_gpsm = _evaluate_predictions_on_coco_gpsm(coco_gt, coco_dt, metrics) + logger.info( + "Evaluation results for densepose, GPSm metric: \n" + create_small_table(results_gpsm) + ) + return results_gps, results_gpsm + + +def _evaluate_predictions_on_coco_gps(coco_gt, coco_dt, metrics): + coco_eval = DensePoseCocoEval(coco_gt, coco_dt, "densepose", dpEvalMode=DensePoseEvalMode.GPS) + coco_eval.evaluate() + coco_eval.accumulate() + coco_eval.summarize() + results = {metric: float(coco_eval.stats[idx] * 100) for idx, metric in enumerate(metrics)} + return results + + +def _evaluate_predictions_on_coco_gpsm(coco_gt, coco_dt, metrics): + coco_eval = DensePoseCocoEval(coco_gt, coco_dt, "densepose", dpEvalMode=DensePoseEvalMode.GPSM) + coco_eval.evaluate() + coco_eval.accumulate() + coco_eval.summarize() + results = {metric: float(coco_eval.stats[idx] * 100) for idx, metric in enumerate(metrics)} + return results diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/densepose/roi_head.py b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/densepose/roi_head.py new file mode 100644 index 0000000000000000000000000000000000000000..80074eee93c043a7369b791143f0433ebc15642e --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/densepose/roi_head.py @@ -0,0 +1,213 @@ +# -*- coding: utf-8 -*- +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved + +import numpy as np +from typing import Dict +import fvcore.nn.weight_init as weight_init +import torch +import torch.nn as nn +from torch.nn import functional as F + +from detectron2.layers import Conv2d, ShapeSpec, get_norm +from detectron2.modeling import ROI_HEADS_REGISTRY, StandardROIHeads +from detectron2.modeling.poolers import ROIPooler +from detectron2.modeling.roi_heads import select_foreground_proposals + +from .densepose_head import ( + build_densepose_data_filter, + build_densepose_head, + build_densepose_losses, + build_densepose_predictor, + densepose_inference, +) + + +class Decoder(nn.Module): + """ + A semantic segmentation head described in detail in the Panoptic Feature Pyramid Networks paper + (https://arxiv.org/abs/1901.02446). It takes FPN features as input and merges information from + all levels of the FPN into single output. + """ + + def __init__(self, cfg, input_shape: Dict[str, ShapeSpec], in_features): + super(Decoder, self).__init__() + + # fmt: off + self.in_features = in_features + feature_strides = {k: v.stride for k, v in input_shape.items()} + feature_channels = {k: v.channels for k, v in input_shape.items()} + num_classes = cfg.MODEL.ROI_DENSEPOSE_HEAD.DECODER_NUM_CLASSES + conv_dims = cfg.MODEL.ROI_DENSEPOSE_HEAD.DECODER_CONV_DIMS + self.common_stride = cfg.MODEL.ROI_DENSEPOSE_HEAD.DECODER_COMMON_STRIDE + norm = cfg.MODEL.ROI_DENSEPOSE_HEAD.DECODER_NORM + # fmt: on + + self.scale_heads = [] + for in_feature in self.in_features: + head_ops = [] + head_length = max( + 1, int(np.log2(feature_strides[in_feature]) - np.log2(self.common_stride)) + ) + for k in range(head_length): + conv = Conv2d( + feature_channels[in_feature] if k == 0 else conv_dims, + conv_dims, + kernel_size=3, + stride=1, + padding=1, + bias=not norm, + norm=get_norm(norm, conv_dims), + activation=F.relu, + ) + weight_init.c2_msra_fill(conv) + head_ops.append(conv) + if feature_strides[in_feature] != self.common_stride: + head_ops.append( + nn.Upsample(scale_factor=2, mode="bilinear", align_corners=False) + ) + self.scale_heads.append(nn.Sequential(*head_ops)) + self.add_module(in_feature, self.scale_heads[-1]) + self.predictor = Conv2d(conv_dims, num_classes, kernel_size=1, stride=1, padding=0) + weight_init.c2_msra_fill(self.predictor) + + def forward(self, features): + for i, _ in enumerate(self.in_features): + if i == 0: + x = self.scale_heads[i](features[i]) + else: + x = x + self.scale_heads[i](features[i]) + x = self.predictor(x) + return x + + +@ROI_HEADS_REGISTRY.register() +class DensePoseROIHeads(StandardROIHeads): + """ + A Standard ROIHeads which contains an addition of DensePose head. + """ + + def __init__(self, cfg, input_shape): + super().__init__(cfg, input_shape) + self._init_densepose_head(cfg, input_shape) + + def _init_densepose_head(self, cfg, input_shape): + # fmt: off + self.densepose_on = cfg.MODEL.DENSEPOSE_ON + if not self.densepose_on: + return + self.densepose_data_filter = build_densepose_data_filter(cfg) + dp_pooler_resolution = cfg.MODEL.ROI_DENSEPOSE_HEAD.POOLER_RESOLUTION + dp_pooler_sampling_ratio = cfg.MODEL.ROI_DENSEPOSE_HEAD.POOLER_SAMPLING_RATIO + dp_pooler_type = cfg.MODEL.ROI_DENSEPOSE_HEAD.POOLER_TYPE + self.use_decoder = cfg.MODEL.ROI_DENSEPOSE_HEAD.DECODER_ON + # fmt: on + if self.use_decoder: + dp_pooler_scales = (1.0 / input_shape[self.in_features[0]].stride,) + else: + dp_pooler_scales = tuple(1.0 / input_shape[k].stride for k in self.in_features) + in_channels = [input_shape[f].channels for f in self.in_features][0] + + if self.use_decoder: + self.decoder = Decoder(cfg, input_shape, self.in_features) + + self.densepose_pooler = ROIPooler( + output_size=dp_pooler_resolution, + scales=dp_pooler_scales, + sampling_ratio=dp_pooler_sampling_ratio, + pooler_type=dp_pooler_type, + ) + self.densepose_head = build_densepose_head(cfg, in_channels) + self.densepose_predictor = build_densepose_predictor( + cfg, self.densepose_head.n_out_channels + ) + self.densepose_losses = build_densepose_losses(cfg) + + def _forward_densepose(self, features, instances): + """ + Forward logic of the densepose prediction branch. + + Args: + features (list[Tensor]): #level input features for densepose prediction + instances (list[Instances]): the per-image instances to train/predict densepose. + In training, they can be the proposals. + In inference, they can be the predicted boxes. + + Returns: + In training, a dict of losses. + In inference, update `instances` with new fields "densepose" and return it. + """ + if not self.densepose_on: + return {} if self.training else instances + + features = [features[f] for f in self.in_features] + if self.training: + proposals, _ = select_foreground_proposals(instances, self.num_classes) + proposals_dp = self.densepose_data_filter(proposals) + if len(proposals_dp) > 0: + # NOTE may deadlock in DDP if certain workers have empty proposals_dp + proposal_boxes = [x.proposal_boxes for x in proposals_dp] + + if self.use_decoder: + features = [self.decoder(features)] + + features_dp = self.densepose_pooler(features, proposal_boxes) + densepose_head_outputs = self.densepose_head(features_dp) + densepose_outputs, _, confidences, _ = self.densepose_predictor( + densepose_head_outputs + ) + densepose_loss_dict = self.densepose_losses( + proposals_dp, densepose_outputs, confidences + ) + return densepose_loss_dict + else: + pred_boxes = [x.pred_boxes for x in instances] + + if self.use_decoder: + features = [self.decoder(features)] + + features_dp = self.densepose_pooler(features, pred_boxes) + if len(features_dp) > 0: + densepose_head_outputs = self.densepose_head(features_dp) + densepose_outputs, _, confidences, _ = self.densepose_predictor( + densepose_head_outputs + ) + else: + # If no detection occurred instances + # set densepose_outputs to empty tensors + empty_tensor = torch.zeros(size=(0, 0, 0, 0), device=features_dp.device) + densepose_outputs = tuple([empty_tensor] * 4) + confidences = tuple([empty_tensor] * 4) + + densepose_inference(densepose_outputs, confidences, instances) + return instances + + def forward(self, images, features, proposals, targets=None): + instances, losses = super().forward(images, features, proposals, targets) + del targets, images + + if self.training: + losses.update(self._forward_densepose(features, instances)) + return instances, losses + + def forward_with_given_boxes(self, features, instances): + """ + Use the given boxes in `instances` to produce other (non-box) per-ROI outputs. + + This is useful for downstream tasks where a box is known, but need to obtain + other attributes (outputs of other heads). + Test-time augmentation also uses this. + + Args: + features: same as in `forward()` + instances (list[Instances]): instances to predict other outputs. Expect the keys + "pred_boxes" and "pred_classes" to exist. + + Returns: + instances (list[Instances]): + the same `Instances` objects, with extra + fields such as `pred_masks` or `pred_keypoints`. + """ + + instances = super().forward_with_given_boxes(features, instances) + instances = self._forward_densepose(features, instances) + return instances diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/dev/README.md b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/dev/README.md new file mode 100644 index 0000000000000000000000000000000000000000..293617f975079e0cdda04dbdb349b5e844efefe1 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/dev/README.md @@ -0,0 +1,7 @@ + +## Some scripts for developers to use, include: + +- `run_instant_tests.sh`: run training for a few iterations. +- `run_inference_tests.sh`: run inference on a small dataset. +- `../../dev/linter.sh`: lint the codebase before commit +- `../../dev/parse_results.sh`: parse results from log file. diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/dev/run_inference_tests.sh b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/dev/run_inference_tests.sh new file mode 100644 index 0000000000000000000000000000000000000000..36a74cf3641d58c47f14b89f352a9286b49822ca --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/dev/run_inference_tests.sh @@ -0,0 +1,33 @@ +#!/bin/bash -e +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved + +BIN="python train_net.py" +OUTPUT="inference_test_output" +NUM_GPUS=2 +IMS_PER_GPU=2 +IMS_PER_BATCH=$(( NUM_GPUS * IMS_PER_GPU )) + +CFG_LIST=( "${@:1}" ) + +if [ ${#CFG_LIST[@]} -eq 0 ]; then + CFG_LIST=( ./configs/quick_schedules/*inference_acc_test.yaml ) +fi + +echo "========================================================================" +echo "Configs to run:" +echo "${CFG_LIST[@]}" +echo "========================================================================" + +for cfg in "${CFG_LIST[@]}"; do + echo "========================================================================" + echo "Running $cfg ..." + echo "========================================================================" + $BIN \ + --eval-only \ + --num-gpus $NUM_GPUS \ + --config-file "$cfg" \ + OUTPUT_DIR "$OUTPUT" \ + SOLVER.IMS_PER_BATCH $IMS_PER_BATCH + rm -rf $OUTPUT +done + diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/dev/run_instant_tests.sh b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/dev/run_instant_tests.sh new file mode 100644 index 0000000000000000000000000000000000000000..644b667e91ba68527e68dd34a69c87ddc303f57e --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/dev/run_instant_tests.sh @@ -0,0 +1,28 @@ +#!/bin/bash -e +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved + +BIN="python train_net.py" +OUTPUT="instant_test_output" +NUM_GPUS=2 +SOLVER_IMS_PER_BATCH=$((NUM_GPUS * 2)) + +CFG_LIST=( "${@:1}" ) +if [ ${#CFG_LIST[@]} -eq 0 ]; then + CFG_LIST=( ./configs/quick_schedules/*instant_test.yaml ) +fi + +echo "========================================================================" +echo "Configs to run:" +echo "${CFG_LIST[@]}" +echo "========================================================================" + +for cfg in "${CFG_LIST[@]}"; do + echo "========================================================================" + echo "Running $cfg ..." + echo "========================================================================" + $BIN --num-gpus $NUM_GPUS --config-file "$cfg" \ + SOLVER.IMS_PER_BATCH $SOLVER_IMS_PER_BATCH \ + OUTPUT_DIR "$OUTPUT" + rm -rf "$OUTPUT" +done + diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/doc/GETTING_STARTED.md b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/doc/GETTING_STARTED.md new file mode 100644 index 0000000000000000000000000000000000000000..daf671d751ddfe21b56e7bd0a75ca97270f27be8 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/doc/GETTING_STARTED.md @@ -0,0 +1,58 @@ +# Getting Started with DensePose + +## Inference with Pre-trained Models + +1. Pick a model and its config file from [Model Zoo](MODEL_ZOO.md), for example [densepose_rcnn_R_50_FPN_s1x.yaml](../configs/densepose_rcnn_R_50_FPN_s1x.yaml) +2. Run the [Apply Net](TOOL_APPLY_NET.md) tool to visualize the results or save the to disk. For example, to use contour visualization for DensePose, one can run: +```bash +python apply_net.py show configs/densepose_rcnn_R_50_FPN_s1x.yaml densepose_rcnn_R_50_FPN_s1x.pkl image.jpg dp_contour,bbox --output image_densepose_contour.png +``` +Please see [Apply Net](TOOL_APPLY_NET.md) for more details on the tool. + +## Training + +First, prepare the [dataset](http://densepose.org/#dataset) into the following structure under the directory you'll run training scripts: +
+datasets/coco/
+  annotations/
+    densepose_{train,minival,valminusminival}2014.json
+    densepose_minival2014_100.json   (optional, for testing only)
+  {train,val}2014/
+    # image files that are mentioned in the corresponding json
+
+ +To train a model one can use the [train_net.py](../train_net.py) script. +This script was used to train all DensePose models in [Model Zoo](MODEL_ZOO.md). +For example, to launch end-to-end DensePose-RCNN training with ResNet-50 FPN backbone +on 8 GPUs following the s1x schedule, one can run +```bash +python train_net.py --config-file configs/densepose_rcnn_R_50_FPN_s1x.yaml --num-gpus 8 +``` +The configs are made for 8-GPU training. To train on 1 GPU, one can apply the +[linear learning rate scaling rule](https://arxiv.org/abs/1706.02677): +```bash +python train_net.py --config-file configs/densepose_rcnn_R_50_FPN_s1x.yaml \ + SOLVER.IMS_PER_BATCH 2 SOLVER.BASE_LR 0.0025 +``` + +## Evaluation + +Model testing can be done in the same way as training, except for an additional flag `--eval-only` and +model location specification through `MODEL.WEIGHTS model.pth` in the command line +```bash +python train_net.py --config-file configs/densepose_rcnn_R_50_FPN_s1x.yaml \ + --eval-only MODEL.WEIGHTS model.pth +``` + +## Tools + +We provide tools which allow one to: + - easily view DensePose annotated data in a dataset; + - perform DensePose inference on a set of images; + - visualize DensePose model results; + +`query_db` is a tool to print or visualize DensePose data in a dataset. +Please refer to [Query DB](TOOL_QUERY_DB.md) for more details on this tool + +`apply_net` is a tool to print or visualize DensePose results. +Please refer to [Apply Net](TOOL_APPLY_NET.md) for more details on this tool diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/doc/MODEL_ZOO.md b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/doc/MODEL_ZOO.md new file mode 100644 index 0000000000000000000000000000000000000000..5ca40f125feea9c1eaf901b58a1fc9e5ac762045 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/doc/MODEL_ZOO.md @@ -0,0 +1,277 @@ +# Model Zoo and Baselines + +# Introduction + +We provide baselines trained with Detectron2 DensePose. The corresponding +configuration files can be found in the [configs](../configs) directory. +All models were trained on COCO `train2014` + `valminusminival2014` and +evaluated on COCO `minival2014`. For the details on common settings in which +baselines were trained, please check [Detectron 2 Model Zoo](../../../MODEL_ZOO.md). + +## License + +All models available for download through this document are licensed under the +[Creative Commons Attribution-ShareAlike 3.0 license](https://creativecommons.org/licenses/by-sa/3.0/) + +## COCO DensePose Baselines with DensePose-RCNN + +### Legacy Models + +Baselines trained using schedules from [Güler et al, 2018](https://arxiv.org/pdf/1802.00434.pdf) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Namelr
sched
train
time
(s/iter)
inference
time
(s/im)
train
mem
(GB)
box
AP
dp. AP
GPS
dp. AP
GPSm
model iddownload
R_50_FPN_s1x_legacys1x0.3070.0513.258.152.154.9164832157model | metrics
R_101_FPN_s1x_legacys1x0.3900.0634.359.553.256.1164832182model | metrics
+ +### Improved Baselines, Original Fully Convolutional Haad + +These models use an improved training schedule and Panoptic FPN head from [Kirillov et al, 2019](https://arxiv.org/abs/1901.02446). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Namelr
sched
train
time
(s/iter)
inference
time
(s/im)
train
mem
(GB)
box
AP
dp. AP
GPS
dp. AP
GPSm
model iddownload
R_50_FPN_s1xs1x0.3590.0664.561.263.765.3165712039model | metrics
R_101_FPN_s1xs1x0.4280.0795.862.364.566.4165712084model | metrics
+ +### Improved Baselines, DeepLabV3 Head + +These models use an improved training schedule, Panoptic FPN head from [Kirillov et al, 2019](https://arxiv.org/abs/1901.02446) and DeepLabV3 head from [Chen et al, 2017](https://arxiv.org/abs/1706.05587). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Namelr
sched
train
time
(s/iter)
inference
time
(s/im)
train
mem
(GB)
box
AP
dp. AP
GPS
dp. AP
GPSm
model iddownload
R_50_FPN_DL_s1xs1x0.3920.0706.761.165.666.8165712097model | metrics
R_101_FPN_DL_s1xs1x0.4780.0837.062.366.367.7165712116model | metrics
+ +### Baselines with Confidence Estimation + +These models perform additional estimation of confidence in regressed UV coodrinates, along the lines of [Neverova et al., 2019](https://papers.nips.cc/paper/8378-correlated-uncertainty-for-learning-dense-correspondences-from-noisy-labels). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Namelr
sched
train
time
(s/iter)
inference
time
(s/im)
train
mem
(GB)
box
AP
dp. AP
GPS
dp. AP
GPSm
model iddownload
R_50_FPN_WC1_s1xs1x0.3530.0644.660.564.265.6173862049model | metrics
R_50_FPN_WC2_s1xs1x0.3640.0664.860.764.265.7173861455model | metrics
R_50_FPN_DL_WC1_s1xs1x0.3970.0686.761.165.867.1173067973model | metrics
R_50_FPN_DL_WC2_s1xs1x0.4100.0706.860.865.666.7173859335model | metrics
R_101_FPN_WC1_s1xs1x0.4350.0765.762.564.966.5171402969model | metrics
R_101_FPN_WC2_s1xs1x0.4500.0785.762.364.866.6173860702model | metrics
R_101_FPN_DL_WC1_s1xs1x0.4790.0817.962.066.267.4173858525model | metrics
R_101_FPN_DL_WC2_s1xs1x0.4910.0827.661.765.967.3173294801model | metrics
+ +## Old Baselines + +It is still possible to use some baselines from [DensePose 1](https://github.com/facebookresearch/DensePose). +Below are evaluation metrics for the baselines recomputed in the current framework: + +| Model | bbox AP | AP | AP50 | AP75 | APm |APl | +|-----|-----|-----|--- |--- |--- |--- | +| [`ResNet50_FPN_s1x-e2e`](https://dl.fbaipublicfiles.com/densepose/DensePose_ResNet50_FPN_s1x-e2e.pkl) | 54.673 | 48.894 | 84.963 | 50.717 | 43.132 | 50.433 | +| [`ResNet101_FPN_s1x-e2e`](https://dl.fbaipublicfiles.com/densepose/DensePose_ResNet101_FPN_s1x-e2e.pkl) | 56.032 | 51.088 | 86.250 | 55.057 | 46.542 | 52.563 | + +Note: these scores are close, but not strictly equal to the ones reported in the [DensePose 1 Model Zoo](https://github.com/facebookresearch/DensePose/blob/master/MODEL_ZOO.md), +which is due to small incompatibilities between the frameworks. diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/doc/TOOL_APPLY_NET.md b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/doc/TOOL_APPLY_NET.md new file mode 100644 index 0000000000000000000000000000000000000000..6c00c66c142faf756e39312623466122ec16613f --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/doc/TOOL_APPLY_NET.md @@ -0,0 +1,130 @@ +# Apply Net + +`apply_net` is a tool to print or visualize DensePose results on a set of images. +It has two modes: `dump` to save DensePose model results to a pickle file +and `show` to visualize them on images. + +## Dump Mode + +The general command form is: +```bash +python apply_net.py dump [-h] [-v] [--output ] +``` + +There are three mandatory arguments: + - ``, configuration file for a given model; + - ``, model file with trained parameters + - ``, input image file name, pattern or folder + +One can additionally provide `--output` argument to define the output file name, +which defaults to `output.pkl`. + + +Examples: + +1. Dump results of a DensePose model with ResNet-50 FPN backbone for images + in a folder `images` to file `dump.pkl`: +```bash +python apply_net.py dump configs/densepose_rcnn_R_50_FPN_s1x.yaml DensePose_ResNet50_FPN_s1x-e2e.pkl images --output dump.pkl -v +``` + +2. Dump results of a DensePose model with ResNet-50 FPN backbone for images + with file name matching a pattern `image*.jpg` to file `results.pkl`: +```bash +python apply_net.py dump configs/densepose_rcnn_R_50_FPN_s1x.yaml DensePose_ResNet50_FPN_s1x-e2e.pkl "image*.jpg" --output results.pkl -v +``` + +If you want to load the pickle file generated by the above command: +``` +# make sure DensePose is in your PYTHONPATH, or use the following line to add it: +sys.path.append("/your_detectron2_path/detectron2_repo/projects/DensePose/") + +f = open('/your_result_path/results.pkl', 'rb') +data = pickle.load(f) +``` + +The file `results.pkl` contains the list of results per image, for each image the result is a dictionary: +``` +data: [{'file_name': '/your_path/image1.jpg', + 'scores': tensor([0.9884]), + 'pred_boxes_XYXY': tensor([[ 69.6114, 0.0000, 706.9797, 706.0000]]), + 'pred_densepose': }, + {'file_name': '/your_path/image2.jpg', + 'scores': tensor([0.9999, 0.5373, 0.3991]), + 'pred_boxes_XYXY': tensor([[ 59.5734, 7.7535, 579.9311, 932.3619], + [612.9418, 686.1254, 612.9999, 704.6053], + [164.5081, 407.4034, 598.3944, 920.4266]]), + 'pred_densepose': }] +``` + +We can use the following code, to parse the outputs of the first +detected instance on the first image. +``` +img_id, instance_id = 0, 0 # Look at the first image and the first detected instance +bbox_xyxy = data[img_id]['pred_boxes_XYXY'][instance_id] +result_encoded = data[img_id]['pred_densepose'].results[instance_id] +iuv_arr = DensePoseResult.decode_png_data(*result_encoded) +``` +The array `bbox_xyxy` contains (x0, y0, x1, y1) of the bounding box. + +The shape of `iuv_arr` is `[3, H, W]`, where (H, W) is the shape of the bounding box. +- `iuv_arr[0,:,:]`: The patch index of image points, indicating which of the 24 surface patches the point is on. +- `iuv_arr[1,:,:]`: The U-coordinate value of image points. +- `iuv_arr[2,:,:]`: The V-coordinate value of image points. + + +## Visualization Mode + +The general command form is: +```bash +python apply_net.py show [-h] [-v] [--min_score ] [--nms_thresh ] [--output ] +``` + +There are four mandatory arguments: + - ``, configuration file for a given model; + - ``, model file with trained parameters + - ``, input image file name, pattern or folder + - ``, visualizations specifier; currently available visualizations are: + * `bbox` - bounding boxes of detected persons; + * `dp_segm` - segmentation masks for detected persons; + * `dp_u` - each body part is colored according to the estimated values of the + U coordinate in part parameterization; + * `dp_v` - each body part is colored according to the estimated values of the + V coordinate in part parameterization; + * `dp_contour` - plots contours with color-coded U and V coordinates + + +One can additionally provide the following optional arguments: + - `--min_score` to only show detections with sufficient scores that are not lower than provided value + - `--nms_thresh` to additionally apply non-maximum suppression to detections at a given threshold + - `--output` to define visualization file name template, which defaults to `output.png`. + To distinguish output file names for different images, the tool appends 1-based entry index, + e.g. output.0001.png, output.0002.png, etc... + + +The following examples show how to output results of a DensePose model +with ResNet-50 FPN backbone using different visualizations for image `image.jpg`: + +1. Show bounding box and segmentation: +```bash +python apply_net.py show configs/densepose_rcnn_R_50_FPN_s1x.yaml DensePose_ResNet50_FPN_s1x-e2e.pkl image.jpg bbox,dp_segm -v +``` +![Bounding Box + Segmentation Visualization](images/res_bbox_dp_segm.jpg) + +2. Show bounding box and estimated U coordinates for body parts: +```bash +python apply_net.py show configs/densepose_rcnn_R_50_FPN_s1x.yaml DensePose_ResNet50_FPN_s1x-e2e.pkl image.jpg bbox,dp_u -v +``` +![Bounding Box + U Coordinate Visualization](images/res_bbox_dp_u.jpg) + +3. Show bounding box and estimated V coordinates for body parts: +```bash +python apply_net.py show configs/densepose_rcnn_R_50_FPN_s1x.yaml DensePose_ResNet50_FPN_s1x-e2e.pkl image.jpg bbox,dp_v -v +``` +![Bounding Box + V Coordinate Visualization](images/res_bbox_dp_v.jpg) + +4. Show bounding box and estimated U and V coordinates via contour plots: +```bash +python apply_net.py show configs/densepose_rcnn_R_50_FPN_s1x.yaml DensePose_ResNet50_FPN_s1x-e2e.pkl image.jpg dp_contour,bbox -v +``` +![Bounding Box + Contour Visualization](images/res_bbox_dp_contour.jpg) diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/doc/TOOL_QUERY_DB.md b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/doc/TOOL_QUERY_DB.md new file mode 100644 index 0000000000000000000000000000000000000000..e8d99a7a65f3b924dd32431c41bd4b985b357106 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/doc/TOOL_QUERY_DB.md @@ -0,0 +1,105 @@ + +# Query Dataset + +`query_db` is a tool to print or visualize DensePose data from a dataset. +It has two modes: `print` and `show` to output dataset entries to standard +output or to visualize them on images. + +## Print Mode + +The general command form is: +```bash +python query_db.py print [-h] [-v] [--max-entries N] +``` + +There are two mandatory arguments: + - ``, DensePose dataset specification, from which to select + the entries (e.g. `densepose_coco_2014_train`). + - ``, dataset entry selector which can be a single specification, + or a comma-separated list of specifications of the form + `field[:type]=value` for exact match with the value + or `field[:type]=min-max` for a range of values + +One can additionally limit the maximum number of entries to output +by providing `--max-entries` argument. + +Examples: + +1. Output at most 10 first entries from the `densepose_coco_2014_train` dataset: +```bash +python query_db.py print densepose_coco_2014_train \* --max-entries 10 -v +``` + +2. Output all entries with `file_name` equal to `COCO_train2014_000000000036.jpg`: +```bash +python query_db.py print densepose_coco_2014_train file_name=COCO_train2014_000000000036.jpg -v +``` + +3. Output all entries with `image_id` between 36 and 156: +```bash +python query_db.py print densepose_coco_2014_train image_id:int=36-156 -v +``` + +## Visualization Mode + +The general command form is: +```bash +python query_db.py show [-h] [-v] [--max-entries N] [--output ] +``` + +There are three mandatory arguments: + - ``, DensePose dataset specification, from which to select + the entries (e.g. `densepose_coco_2014_train`). + - ``, dataset entry selector which can be a single specification, + or a comma-separated list of specifications of the form + `field[:type]=value` for exact match with the value + or `field[:type]=min-max` for a range of values + - ``, visualizations specifier; currently available visualizations are: + * `bbox` - bounding boxes of annotated persons; + * `dp_i` - annotated points colored according to the containing part; + * `dp_pts` - annotated points in green color; + * `dp_segm` - segmentation masks for annotated persons; + * `dp_u` - annotated points colored according to their U coordinate in part parameterization; + * `dp_v` - annotated points colored according to their V coordinate in part parameterization; + +One can additionally provide one of the two optional arguments: + - `--max_entries` to limit the maximum number of entries to visualize + - `--output` to provide visualization file name template, which defaults + to `output.png`. To distinguish file names for different dataset + entries, the tool appends 1-based entry index to the output file name, + e.g. output.0001.png, output.0002.png, etc. + +The following examples show how to output different visualizations for image with `id = 322` +from `densepose_coco_2014_train` dataset: + +1. Show bounding box and segmentation: +```bash +python query_db.py show densepose_coco_2014_train image_id:int=322 bbox,dp_segm -v +``` +![Bounding Box + Segmentation Visualization](images/vis_bbox_dp_segm.jpg) + +2. Show bounding box and points colored according to the containing part: +```bash +python query_db.py show densepose_coco_2014_train image_id:int=322 bbox,dp_i -v +``` +![Bounding Box + Point Label Visualization](images/vis_bbox_dp_i.jpg) + +3. Show bounding box and annotated points in green color: +```bash +python query_db.py show densepose_coco_2014_train image_id:int=322 bbox,dp_segm -v +``` +![Bounding Box + Point Visualization](images/vis_bbox_dp_pts.jpg) + +4. Show bounding box and annotated points colored according to their U coordinate in part parameterization: +```bash +python query_db.py show densepose_coco_2014_train image_id:int=322 bbox,dp_u -v +``` +![Bounding Box + Point U Visualization](images/vis_bbox_dp_u.jpg) + +5. Show bounding box and annotated points colored according to their V coordinate in part parameterization: +```bash +python query_db.py show densepose_coco_2014_train image_id:int=322 bbox,dp_v -v +``` +![Bounding Box + Point V Visualization](images/vis_bbox_dp_v.jpg) + + diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/tests/common.py b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/tests/common.py new file mode 100644 index 0000000000000000000000000000000000000000..44f31ce27c1c0e6bef75241de28423e866328684 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/tests/common.py @@ -0,0 +1,110 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + +import os +import torch + +from detectron2.config import get_cfg +from detectron2.engine import default_setup +from detectron2.modeling import build_model + +from densepose import add_dataset_category_config, add_densepose_config + +_BASE_CONFIG_DIR = "configs" +_EVOLUTION_CONFIG_SUB_DIR = "evolution" +_QUICK_SCHEDULES_CONFIG_SUB_DIR = "quick_schedules" +_BASE_CONFIG_FILE_PREFIX = "Base-" +_CONFIG_FILE_EXT = ".yaml" + + +def _get_base_config_dir(): + """ + Return the base directory for configurations + """ + return os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", _BASE_CONFIG_DIR) + + +def _get_evolution_config_dir(): + """ + Return the base directory for evolution configurations + """ + return os.path.join(_get_base_config_dir(), _EVOLUTION_CONFIG_SUB_DIR) + + +def _get_quick_schedules_config_dir(): + """ + Return the base directory for quick schedules configurations + """ + return os.path.join(_get_base_config_dir(), _QUICK_SCHEDULES_CONFIG_SUB_DIR) + + +def _collect_config_files(config_dir): + """ + Collect all configuration files (i.e. densepose_*.yaml) directly in the specified directory + """ + start = _get_base_config_dir() + results = [] + for entry in os.listdir(config_dir): + path = os.path.join(config_dir, entry) + if not os.path.isfile(path): + continue + _, ext = os.path.splitext(entry) + if ext != _CONFIG_FILE_EXT: + continue + if entry.startswith(_BASE_CONFIG_FILE_PREFIX): + continue + config_file = os.path.relpath(path, start) + results.append(config_file) + return results + + +def get_config_files(): + """ + Get all the configuration files (relative to the base configuration directory) + """ + return _collect_config_files(_get_base_config_dir()) + + +def get_evolution_config_files(): + """ + Get all the evolution configuration files (relative to the base configuration directory) + """ + return _collect_config_files(_get_evolution_config_dir()) + + +def get_quick_schedules_config_files(): + """ + Get all the quick schedules configuration files (relative to the base configuration directory) + """ + return _collect_config_files(_get_quick_schedules_config_dir()) + + +def _get_model_config(config_file): + """ + Load and return the configuration from the specified file (relative to the base configuration + directory) + """ + cfg = get_cfg() + add_dataset_category_config(cfg) + add_densepose_config(cfg) + path = os.path.join(_get_base_config_dir(), config_file) + cfg.merge_from_file(path) + if not torch.cuda.is_available(): + cfg.MODEL_DEVICE = "cpu" + return cfg + + +def get_model(config_file): + """ + Get the model from the specified file (relative to the base configuration directory) + """ + cfg = _get_model_config(config_file) + return build_model(cfg) + + +def setup(config_file): + """ + Setup the configuration from the specified file (relative to the base configuration directory) + """ + cfg = _get_model_config(config_file) + cfg.freeze() + default_setup(cfg, {}) diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/tests/test_model_e2e.py b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/tests/test_model_e2e.py new file mode 100644 index 0000000000000000000000000000000000000000..9557c88b328973bad958822624fb7e36847e3e0e --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/tests/test_model_e2e.py @@ -0,0 +1,43 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + +import unittest +import torch + +from detectron2.structures import BitMasks, Boxes, Instances + +from .common import get_model + + +# TODO(plabatut): Modularize detectron2 tests and re-use +def make_model_inputs(image, instances=None): + if instances is None: + return {"image": image} + + return {"image": image, "instances": instances} + + +def make_empty_instances(h, w): + instances = Instances((h, w)) + instances.gt_boxes = Boxes(torch.rand(0, 4)) + instances.gt_classes = torch.tensor([]).to(dtype=torch.int64) + instances.gt_masks = BitMasks(torch.rand(0, h, w)) + return instances + + +class ModelE2ETest(unittest.TestCase): + CONFIG_PATH = "" + + def setUp(self): + self.model = get_model(self.CONFIG_PATH) + + def _test_eval(self, sizes): + inputs = [make_model_inputs(torch.rand(3, size[0], size[1])) for size in sizes] + self.model.eval() + self.model(inputs) + + +class DensePoseRCNNE2ETest(ModelE2ETest): + CONFIG_PATH = "densepose_rcnn_R_101_FPN_s1x.yaml" + + def test_empty_data(self): + self._test_eval([(200, 250), (200, 249)]) diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/tests/test_setup.py b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/tests/test_setup.py new file mode 100644 index 0000000000000000000000000000000000000000..983961761783103a36390de034a81f7b4d7d160b --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/tests/test_setup.py @@ -0,0 +1,30 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + +import unittest + +from .common import ( + get_config_files, + get_evolution_config_files, + get_quick_schedules_config_files, + setup, +) + + +class TestSetup(unittest.TestCase): + def _test_setup(self, config_file): + setup(config_file) + + def test_setup_configs(self): + config_files = get_config_files() + for config_file in config_files: + self._test_setup(config_file) + + def test_setup_evolution_configs(self): + config_files = get_evolution_config_files() + for config_file in config_files: + self._test_setup(config_file) + + def test_setup_quick_schedules_configs(self): + config_files = get_quick_schedules_config_files() + for config_file in config_files: + self._test_setup(config_file) diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/tests/test_structures.py b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/tests/test_structures.py new file mode 100644 index 0000000000000000000000000000000000000000..41f752ec2ce766fbce5b778c9f56448b159977c0 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/DensePose/tests/test_structures.py @@ -0,0 +1,25 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + +import unittest + +from densepose.data.structures import normalized_coords_transform + + +class TestStructures(unittest.TestCase): + def test_normalized_coords_transform(self): + bbox = (32, 24, 288, 216) + x0, y0, w, h = bbox + xmin, ymin, xmax, ymax = x0, y0, x0 + w, y0 + h + f = normalized_coords_transform(*bbox) + # Top-left + expected_p, actual_p = (-1, -1), f((xmin, ymin)) + self.assertEqual(expected_p, actual_p) + # Top-right + expected_p, actual_p = (1, -1), f((xmax, ymin)) + self.assertEqual(expected_p, actual_p) + # Bottom-left + expected_p, actual_p = (-1, 1), f((xmin, ymax)) + self.assertEqual(expected_p, actual_p) + # Bottom-right + expected_p, actual_p = (1, 1), f((xmax, ymax)) + self.assertEqual(expected_p, actual_p) diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/PointRend/point_rend/__init__.py b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/PointRend/point_rend/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..38dfbe0f95e5095b0aa4f8a54403d20aadbd70f5 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/PointRend/point_rend/__init__.py @@ -0,0 +1,6 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +from .config import add_pointrend_config +from .coarse_mask_head import CoarseMaskHead +from .roi_heads import PointRendROIHeads +from .dataset_mapper import SemSegDatasetMapper +from .semantic_seg import PointRendSemSegHead diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/PointRend/point_rend/roi_heads.py b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/PointRend/point_rend/roi_heads.py new file mode 100644 index 0000000000000000000000000000000000000000..3d0d71fbf4603ad2bee784e59c626ea9c1cb034c --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/PointRend/point_rend/roi_heads.py @@ -0,0 +1,227 @@ +# -*- coding: utf-8 -*- +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +import numpy as np +import torch + +from detectron2.layers import ShapeSpec, cat, interpolate +from detectron2.modeling import ROI_HEADS_REGISTRY, StandardROIHeads +from detectron2.modeling.roi_heads.mask_head import ( + build_mask_head, + mask_rcnn_inference, + mask_rcnn_loss, +) +from detectron2.modeling.roi_heads.roi_heads import select_foreground_proposals + +from .point_features import ( + generate_regular_grid_point_coords, + get_uncertain_point_coords_on_grid, + get_uncertain_point_coords_with_randomness, + point_sample, + point_sample_fine_grained_features, +) +from .point_head import build_point_head, roi_mask_point_loss + + +def calculate_uncertainty(logits, classes): + """ + We estimate uncerainty as L1 distance between 0.0 and the logit prediction in 'logits' for the + foreground class in `classes`. + + Args: + logits (Tensor): A tensor of shape (R, C, ...) or (R, 1, ...) for class-specific or + class-agnostic, where R is the total number of predicted masks in all images and C is + the number of foreground classes. The values are logits. + classes (list): A list of length R that contains either predicted of ground truth class + for eash predicted mask. + + Returns: + scores (Tensor): A tensor of shape (R, 1, ...) that contains uncertainty scores with + the most uncertain locations having the highest uncertainty score. + """ + if logits.shape[1] == 1: + gt_class_logits = logits.clone() + else: + gt_class_logits = logits[ + torch.arange(logits.shape[0], device=logits.device), classes + ].unsqueeze(1) + return -(torch.abs(gt_class_logits)) + + +@ROI_HEADS_REGISTRY.register() +class PointRendROIHeads(StandardROIHeads): + """ + The RoI heads class for PointRend instance segmentation models. + + In this class we redefine the mask head of `StandardROIHeads` leaving all other heads intact. + To avoid namespace conflict with other heads we use names starting from `mask_` for all + variables that correspond to the mask head in the class's namespace. + """ + + def __init__(self, cfg, input_shape): + # TODO use explicit args style + super().__init__(cfg, input_shape) + self._init_mask_head(cfg, input_shape) + + def _init_mask_head(self, cfg, input_shape): + # fmt: off + self.mask_on = cfg.MODEL.MASK_ON + if not self.mask_on: + return + self.mask_coarse_in_features = cfg.MODEL.ROI_MASK_HEAD.IN_FEATURES + self.mask_coarse_side_size = cfg.MODEL.ROI_MASK_HEAD.POOLER_RESOLUTION + self._feature_scales = {k: 1.0 / v.stride for k, v in input_shape.items()} + # fmt: on + + in_channels = np.sum([input_shape[f].channels for f in self.mask_coarse_in_features]) + self.mask_coarse_head = build_mask_head( + cfg, + ShapeSpec( + channels=in_channels, + width=self.mask_coarse_side_size, + height=self.mask_coarse_side_size, + ), + ) + self._init_point_head(cfg, input_shape) + + def _init_point_head(self, cfg, input_shape): + # fmt: off + self.mask_point_on = cfg.MODEL.ROI_MASK_HEAD.POINT_HEAD_ON + if not self.mask_point_on: + return + assert cfg.MODEL.ROI_HEADS.NUM_CLASSES == cfg.MODEL.POINT_HEAD.NUM_CLASSES + self.mask_point_in_features = cfg.MODEL.POINT_HEAD.IN_FEATURES + self.mask_point_train_num_points = cfg.MODEL.POINT_HEAD.TRAIN_NUM_POINTS + self.mask_point_oversample_ratio = cfg.MODEL.POINT_HEAD.OVERSAMPLE_RATIO + self.mask_point_importance_sample_ratio = cfg.MODEL.POINT_HEAD.IMPORTANCE_SAMPLE_RATIO + # next two parameters are use in the adaptive subdivions inference procedure + self.mask_point_subdivision_steps = cfg.MODEL.POINT_HEAD.SUBDIVISION_STEPS + self.mask_point_subdivision_num_points = cfg.MODEL.POINT_HEAD.SUBDIVISION_NUM_POINTS + # fmt: on + + in_channels = np.sum([input_shape[f].channels for f in self.mask_point_in_features]) + self.mask_point_head = build_point_head( + cfg, ShapeSpec(channels=in_channels, width=1, height=1) + ) + + def _forward_mask(self, features, instances): + """ + Forward logic of the mask prediction branch. + + Args: + features (dict[str, Tensor]): #level input features for mask prediction + instances (list[Instances]): the per-image instances to train/predict masks. + In training, they can be the proposals. + In inference, they can be the predicted boxes. + + Returns: + In training, a dict of losses. + In inference, update `instances` with new fields "pred_masks" and return it. + """ + if not self.mask_on: + return {} if self.training else instances + + if self.training: + proposals, _ = select_foreground_proposals(instances, self.num_classes) + proposal_boxes = [x.proposal_boxes for x in proposals] + mask_coarse_logits = self._forward_mask_coarse(features, proposal_boxes) + + losses = {"loss_mask": mask_rcnn_loss(mask_coarse_logits, proposals)} + losses.update(self._forward_mask_point(features, mask_coarse_logits, proposals)) + return losses + else: + pred_boxes = [x.pred_boxes for x in instances] + mask_coarse_logits = self._forward_mask_coarse(features, pred_boxes) + + mask_logits = self._forward_mask_point(features, mask_coarse_logits, instances) + mask_rcnn_inference(mask_logits, instances) + return instances + + def _forward_mask_coarse(self, features, boxes): + """ + Forward logic of the coarse mask head. + """ + point_coords = generate_regular_grid_point_coords( + np.sum(len(x) for x in boxes), self.mask_coarse_side_size, boxes[0].device + ) + mask_coarse_features_list = [features[k] for k in self.mask_coarse_in_features] + features_scales = [self._feature_scales[k] for k in self.mask_coarse_in_features] + # For regular grids of points, this function is equivalent to `len(features_list)' calls + # of `ROIAlign` (with `SAMPLING_RATIO=2`), and concat the results. + mask_features, _ = point_sample_fine_grained_features( + mask_coarse_features_list, features_scales, boxes, point_coords + ) + return self.mask_coarse_head(mask_features) + + def _forward_mask_point(self, features, mask_coarse_logits, instances): + """ + Forward logic of the mask point head. + """ + if not self.mask_point_on: + return {} if self.training else mask_coarse_logits + + mask_features_list = [features[k] for k in self.mask_point_in_features] + features_scales = [self._feature_scales[k] for k in self.mask_point_in_features] + + if self.training: + proposal_boxes = [x.proposal_boxes for x in instances] + gt_classes = cat([x.gt_classes for x in instances]) + with torch.no_grad(): + point_coords = get_uncertain_point_coords_with_randomness( + mask_coarse_logits, + lambda logits: calculate_uncertainty(logits, gt_classes), + self.mask_point_train_num_points, + self.mask_point_oversample_ratio, + self.mask_point_importance_sample_ratio, + ) + + fine_grained_features, point_coords_wrt_image = point_sample_fine_grained_features( + mask_features_list, features_scales, proposal_boxes, point_coords + ) + coarse_features = point_sample(mask_coarse_logits, point_coords, align_corners=False) + point_logits = self.mask_point_head(fine_grained_features, coarse_features) + return { + "loss_mask_point": roi_mask_point_loss( + point_logits, instances, point_coords_wrt_image + ) + } + else: + pred_boxes = [x.pred_boxes for x in instances] + pred_classes = cat([x.pred_classes for x in instances]) + # The subdivision code will fail with the empty list of boxes + if len(pred_classes) == 0: + return mask_coarse_logits + + mask_logits = mask_coarse_logits.clone() + for subdivions_step in range(self.mask_point_subdivision_steps): + mask_logits = interpolate( + mask_logits, scale_factor=2, mode="bilinear", align_corners=False + ) + # If `mask_point_subdivision_num_points` is larger or equal to the + # resolution of the next step, then we can skip this step + H, W = mask_logits.shape[-2:] + if ( + self.mask_point_subdivision_num_points >= 4 * H * W + and subdivions_step < self.mask_point_subdivision_steps - 1 + ): + continue + uncertainty_map = calculate_uncertainty(mask_logits, pred_classes) + point_indices, point_coords = get_uncertain_point_coords_on_grid( + uncertainty_map, self.mask_point_subdivision_num_points + ) + fine_grained_features, _ = point_sample_fine_grained_features( + mask_features_list, features_scales, pred_boxes, point_coords + ) + coarse_features = point_sample( + mask_coarse_logits, point_coords, align_corners=False + ) + point_logits = self.mask_point_head(fine_grained_features, coarse_features) + + # put mask point predictions to the right places on the upsampled grid. + R, C, H, W = mask_logits.shape + point_indices = point_indices.unsqueeze(1).expand(-1, C, -1) + mask_logits = ( + mask_logits.reshape(R, C, H * W) + .scatter_(2, point_indices, point_logits) + .view(R, C, H, W) + ) + return mask_logits diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/PointRend/point_rend/semantic_seg.py b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/PointRend/point_rend/semantic_seg.py new file mode 100644 index 0000000000000000000000000000000000000000..c7db5a96e341a20f942a702a3980c53fc9e59189 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/py/catvton/SCHP/mhp_extension/detectron2/projects/PointRend/point_rend/semantic_seg.py @@ -0,0 +1,134 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +import numpy as np +from typing import Dict +import torch +from torch import nn +from torch.nn import functional as F + +from detectron2.layers import ShapeSpec, cat +from detectron2.modeling import SEM_SEG_HEADS_REGISTRY + +from .point_features import ( + get_uncertain_point_coords_on_grid, + get_uncertain_point_coords_with_randomness, + point_sample, +) +from .point_head import build_point_head + + +def calculate_uncertainty(sem_seg_logits): + """ + For each location of the prediction `sem_seg_logits` we estimate uncerainty as the + difference between top first and top second predicted logits. + + Args: + mask_logits (Tensor): A tensor of shape (N, C, ...), where N is the minibatch size and + C is the number of foreground classes. The values are logits. + + Returns: + scores (Tensor): A tensor of shape (N, 1, ...) that contains uncertainty scores with + the most uncertain locations having the highest uncertainty score. + """ + top2_scores = torch.topk(sem_seg_logits, k=2, dim=1)[0] + return (top2_scores[:, 1] - top2_scores[:, 0]).unsqueeze(1) + + +@SEM_SEG_HEADS_REGISTRY.register() +class PointRendSemSegHead(nn.Module): + """ + A semantic segmentation head that combines a head set in `POINT_HEAD.COARSE_SEM_SEG_HEAD_NAME` + and a point head set in `MODEL.POINT_HEAD.NAME`. + """ + + def __init__(self, cfg, input_shape: Dict[str, ShapeSpec]): + super().__init__() + + self.ignore_value = cfg.MODEL.SEM_SEG_HEAD.IGNORE_VALUE + + self.coarse_sem_seg_head = SEM_SEG_HEADS_REGISTRY.get( + cfg.MODEL.POINT_HEAD.COARSE_SEM_SEG_HEAD_NAME + )(cfg, input_shape) + self._init_point_head(cfg, input_shape) + + def _init_point_head(self, cfg, input_shape: Dict[str, ShapeSpec]): + # fmt: off + assert cfg.MODEL.SEM_SEG_HEAD.NUM_CLASSES == cfg.MODEL.POINT_HEAD.NUM_CLASSES + feature_channels = {k: v.channels for k, v in input_shape.items()} + self.in_features = cfg.MODEL.POINT_HEAD.IN_FEATURES + self.train_num_points = cfg.MODEL.POINT_HEAD.TRAIN_NUM_POINTS + self.oversample_ratio = cfg.MODEL.POINT_HEAD.OVERSAMPLE_RATIO + self.importance_sample_ratio = cfg.MODEL.POINT_HEAD.IMPORTANCE_SAMPLE_RATIO + self.subdivision_steps = cfg.MODEL.POINT_HEAD.SUBDIVISION_STEPS + self.subdivision_num_points = cfg.MODEL.POINT_HEAD.SUBDIVISION_NUM_POINTS + # fmt: on + + in_channels = np.sum([feature_channels[f] for f in self.in_features]) + self.point_head = build_point_head(cfg, ShapeSpec(channels=in_channels, width=1, height=1)) + + def forward(self, features, targets=None): + coarse_sem_seg_logits = self.coarse_sem_seg_head.layers(features) + + if self.training: + losses = self.coarse_sem_seg_head.losses(coarse_sem_seg_logits, targets) + + with torch.no_grad(): + point_coords = get_uncertain_point_coords_with_randomness( + coarse_sem_seg_logits, + calculate_uncertainty, + self.train_num_points, + self.oversample_ratio, + self.importance_sample_ratio, + ) + coarse_features = point_sample(coarse_sem_seg_logits, point_coords, align_corners=False) + + fine_grained_features = cat( + [ + point_sample(features[in_feature], point_coords, align_corners=False) + for in_feature in self.in_features + ] + ) + point_logits = self.point_head(fine_grained_features, coarse_features) + point_targets = ( + point_sample( + targets.unsqueeze(1).to(torch.float), + point_coords, + mode="nearest", + align_corners=False, + ) + .squeeze(1) + .to(torch.long) + ) + losses["loss_sem_seg_point"] = F.cross_entropy( + point_logits, point_targets, reduction="mean", ignore_index=self.ignore_value + ) + return None, losses + else: + sem_seg_logits = coarse_sem_seg_logits.clone() + for _ in range(self.subdivision_steps): + sem_seg_logits = F.interpolate( + sem_seg_logits, scale_factor=2, mode="bilinear", align_corners=False + ) + uncertainty_map = calculate_uncertainty(sem_seg_logits) + point_indices, point_coords = get_uncertain_point_coords_on_grid( + uncertainty_map, self.subdivision_num_points + ) + fine_grained_features = cat( + [ + point_sample(features[in_feature], point_coords, align_corners=False) + for in_feature in self.in_features + ] + ) + coarse_features = point_sample( + coarse_sem_seg_logits, point_coords, align_corners=False + ) + point_logits = self.point_head(fine_grained_features, coarse_features) + + # put sem seg point predictions to the right places on the upsampled grid. + N, C, H, W = sem_seg_logits.shape + point_indices = point_indices.unsqueeze(1).expand(-1, C, -1) + sem_seg_logits = ( + sem_seg_logits.reshape(N, C, H * W) + .scatter_(2, point_indices, point_logits) + .view(N, C, H, W) + ) + return sem_seg_logits, {} diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/workflow/catvton_example.jpg b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/workflow/catvton_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a0ef01ab0201bf2e224ccaa93ce6f487c854409a --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/workflow/catvton_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57c94fadc81a6f5e05bb37071967bece1563d9445d65636334ba48f4d6370957 +size 468263 diff --git a/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/workflow/girl.jpg b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/workflow/girl.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0f463e8882720b3f8d24d67f5d43a5ebcdf02b3b --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_CatVTON_Wrapper/workflow/girl.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:acd2c30ded05f8522a328f314c1a974a4d881a9a3eb4f40fe557dc46d6ba3017 +size 191609 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/birefnet_ultra_v2_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/birefnet_ultra_v2_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ca9a41f5f3e35132fbc192a8c7817d470348ab57 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/birefnet_ultra_v2_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7614d960f5e789a252a2fa163c421c98fbbdbe49012c2d0e0d78502cf3866014 +size 113389 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/blend_mode_result.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/blend_mode_result.jpg new file mode 100644 index 0000000000000000000000000000000000000000..38eab2421fab305027478c237d494396e0f92af6 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/blend_mode_result.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a7406d010be4a8761d6315dbe81482d7737ae9262957addbaf4bf63101702a2 +size 460297 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/blend_mode_v2_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/blend_mode_v2_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1609f92bf4998ada08b42bf4653cecec9f17c05c --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/blend_mode_v2_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a2103c35526bc2121eb2205d066fd184381fedc6750a8e082d8e162dca90b1d +size 862386 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/blendif_mask_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/blendif_mask_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1ca2f23cad354b1945a1568bd5211b711b9a1b27 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/blendif_mask_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e63e00540c0558fc9a1dc620e605a8e515231eaacc3c97e23f5a74f5f3214109 +size 190602 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/channel_shake_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/channel_shake_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..351012494b117abc97859e61e90cf3400b7738c1 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/channel_shake_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:295c92b51b07ad2fa237306b49051624e5200620094165f0a99e03fb73117807 +size 173676 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_adapter_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_adapter_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2a71099bcac3be43297065ae8fc3ef150dbdb476 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_adapter_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:881ece23211a85f0c7e198bc46fa2bb78e50fadd203202033c6ab0cc5d071d61 +size 251383 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_balance_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_balance_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3928f8e9ef8a32170f0c88c29e7c7901d13f3c07 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_balance_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02d44aed2a8f733ec03621ed825fc35c46fc18ded89d518e3165fc74d5c038d6 +size 179559 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_image_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_image_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e19fd89798023c8b8a95b4082efc4ebae4f491bf --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_image_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b72988e2df15f6877ffab3445f36778d053db2d961bd373f7fc39f73d6977a19 +size 110027 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_of_shadow_and_highlight_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_of_shadow_and_highlight_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..998347586fe31693c610c0d8daf6ef713010787a --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_of_shadow_and_highlight_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f4b3ffc501c9078674cda6326a5d63b19348972967afa6eb36ef6c401152755a +size 244182 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_of_shadow_and_highlight_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_of_shadow_and_highlight_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..75b203be9aa5c3e7501fbccb5132d3935aa764ea --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_of_shadow_and_highlight_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1726e51405bfa17822e836876f37ea74b9109bc3e3f2226f16ecf3132bf04aca +size 115832 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_overlay_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_overlay_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2a39f2addbfc310d20aaa09ef9e1f93eeba2ed2c --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_overlay_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:19eb0d70743ac239f176fd1e0cb57d682a45f53470fd4e38473fd1cddff4a657 +size 122452 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_temperature_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_temperature_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..cc933dffa86c287da41852d01d2924f6a95ad4da --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/color_temperature_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:92119d165fc983080112bab952d19e219a6dde2a8754ae9c1615580524a6628f +size 193365 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/colormap_result.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/colormap_result.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8876d39fde82cb03743bb19166b20056a1b8aaef --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/colormap_result.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6659ccbcefbfc656405426ea821aaa89b2db2b1aa6bf6bb06d746de6872e66fe +size 531623 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/corp_by_mask_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/corp_by_mask_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f2a05f768e4b8bfd49888a0d57fa6e32a39cacbd --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/corp_by_mask_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47cac01e5bcd45ef1f95a0c683345db4fa25328974bbbd0972614dd8522fe3e5 +size 355941 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/corp_by_mask_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/corp_by_mask_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fbcf29d22c90e67eefaf123a7446b5149ec19d0e --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/corp_by_mask_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfeaf61faaa8ec30611a9c78cb4d80cd56412262e80c05cd6a8701518aaf944a +size 113028 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/create_gradient_mask_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/create_gradient_mask_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..74ebfc7979227d5e370d50a2a748d8ce61231b1e --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/create_gradient_mask_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e81f307f18871728114fc1ef841b6612e41e8a024a762410cf9877181dd5b044 +size 297079 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/create_gradient_mask_example2.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/create_gradient_mask_example2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4a2564bce16a9cb5f98e9d358167671ad778318b --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/create_gradient_mask_example2.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ad2c8908bf78a832124ae76eb5e1fc998d055d48fd3352afcbb5c2d1c1ab282 +size 215489 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/data_nodes_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/data_nodes_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..abf58de43dec9b14c736a706b35bfe2c6123a0bf --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/data_nodes_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49d483616c3659dfc04e74d11975773f4dbf4592f7d9f644cb027d419115c589 +size 164108 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/draw_bbox_mask_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/draw_bbox_mask_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9f5edd9bfaf8030be385e9f1d6f2a9c66d9f194d --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/draw_bbox_mask_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cee6d963a01265f80b82647bff1010e2ed2443dcdf2f4b827f92c4c886a4e8d5 +size 358637 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/drop_shadow_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/drop_shadow_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..58427966d2c725743792c698e0d73599085bcff7 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/drop_shadow_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05bb35225281cb2245a5008e998e0c73704fa56c1b5d3ae23ce0dd3e4425e7f4 +size 148107 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/evf_sam_ultra_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/evf_sam_ultra_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..dcee85953afbc23ab759020c796539b1168b0a64 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/evf_sam_ultra_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:564c5ee5b1bb9d230b1f52f3f4950a80e6125d8784eca5c5feac546a0fb97aa1 +size 374838 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/evf_sam_ultra_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/evf_sam_ultra_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b638d9d5018fd530c9a1f2ebd5f036f02ebaa16c --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/evf_sam_ultra_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b9a76063e0662d38f56f27285d684416b05ae3c7662da4cff7d6782d9fe75e2 +size 116146 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/exposure_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/exposure_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d7f5ecc9fa2b42ce7fe960c352495caa57cd5344 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/exposure_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd9a4ca45a6cf20cef57cfb5376c7db4d24ddbad44263115d7f63a14344cb93c +size 227556 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/extend_canvas_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/extend_canvas_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6da2f06ad93bc3342f661ed7e5a5d4c7b81d6108 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/extend_canvas_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1b1cea20b0c09ce98d2104d0388576ef0ff33a7406ce10ae3f587b94032a985 +size 220537 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/extend_canvas_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/extend_canvas_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..89d438d3c562dfcc38090f9d4ef84c87766ed39e --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/extend_canvas_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2108da836ad809f926ed6451e4a3522289dd800d436f5970e39e02e967d874c +size 110845 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/film_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/film_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3a76d72b7d6bea0fb971230285751308d862be08 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/film_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:061984003e5e4e08066ff8e598876bcab296716f167921b919cb9650c4507f3a +size 494998 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/film_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/film_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..95540a12ba625fb757ef0f4a10d6e20fbb4de6bd --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/film_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bad82ae59f8315e0f1d7c32e9e2d086e290957f21a4b6889b92f2f893b90d286 +size 121613 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/florence2_image2prompt_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/florence2_image2prompt_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..cc898238b5c54fa9173a946d56e47b33f1b80b07 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/florence2_image2prompt_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b342ac6d6903f9026f052a678f32923dd22a7a7a3ddc3771438d43a8da47b322 +size 150599 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/florence2_ultra_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/florence2_ultra_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..726db4068e4c0edc018e3bbf0d9ca6e430eb2f62 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/florence2_ultra_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d756dcea4372194a77faca0aed38796bba136fd772229c59d265cc5329034e19 +size 101422 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/gaussian_blur_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/gaussian_blur_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..56ba8eb02c34d918f43b08bdab7893f7c6a1007f --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/gaussian_blur_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0291942349da354a71ee77a5dd6d1444e9e6ae00447fd151c9fcb372628e36e2 +size 125072 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/get_color_tone_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/get_color_tone_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1ffbdaa4953f10af422205298d49e2db62f388c9 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/get_color_tone_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a713c7c733b4e861a79d4f66fa66f1db0254e5ea6baf152f78e1ba201654f0d2 +size 184660 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/get_color_tone_v2_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/get_color_tone_v2_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..de8ad81a34967cc6d3960f8e63196f07c13664d1 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/get_color_tone_v2_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f24aa8a82329cd21a8704ae0b7a7c35bb915bb729c4e66570948b966afb17cf2 +size 188496 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/get_main_color_and_color_name_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/get_main_color_and_color_name_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c600c37dcfca4ed3fd45cb880c189a8a8898ba21 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/get_main_color_and_color_name_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e1ffe6fda8ba28bc526bd2177feb6b28b24b9ca39412cce42dc99629403e960 +size 441626 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/get_main_colors_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/get_main_colors_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e85ee0f1c4fe339c5503126df9e8960a812bd782 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/get_main_colors_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e6207dbb53f96c60fc1a56d549006db0deab1a5ddb2aa5e1731d0c4c4767949 +size 478389 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/gradient_image_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/gradient_image_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a750a3a23544e32b60709d82a1e3f4c3a4cc57cf --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/gradient_image_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ac8bd2bb970926d7ee91e8aac61d65cbfdad542503694a09f52a403a72ea017 +size 136260 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/gradient_overlay_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/gradient_overlay_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a3ba01f63425ea86ca1e4d88737d1d175491e05d --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/gradient_overlay_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46dd25cb3e8f37238354e794fd26b9302752610d81b8397612e34be6f5e1d973 +size 131113 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/hdr_effects_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/hdr_effects_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f07701854209f5b34f6866438b3de6b30fe6def7 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/hdr_effects_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac36035f5cdf764541323babef6dfaca8bd7d8fa69930e2138efc66a8193539d +size 261380 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/hl_frequency_detail_restore_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/hl_frequency_detail_restore_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4c21b3d108d77b1b7249d4cf67544b86efb911a5 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/hl_frequency_detail_restore_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d92fcde3764c7d3560c17d296cf84ea763725574205bb9418930c614912743a +size 140184 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/human_parts_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/human_parts_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1c659e0d309315c585fb11fdc52813f20b5abca0 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/human_parts_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d5c83a0ce55def9f492208cc139fd0467e9bfe867ed9b9db7768ab51e6eae9f8 +size 164200 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/human_parts_ultra_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/human_parts_ultra_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..25710b177af1201fc1cfe96103028c0f5156f57d --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/human_parts_ultra_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0984380ac0c9b7d9cdeb3dbb577f39a9c019f3f26d1f536dad7139d036d33e93 +size 317812 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/if_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/if_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e7e985ed94d87fc43f45489a48605d1f2b56de43 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/if_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99cc5031d194fcbf7cadf2add1236dfe07e5bb42bea50cc34526262eb4bbbefe +size 175656 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_auto_crop_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_auto_crop_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3c504762bd903c068b59a0bd2c4c0aa00cc15afe --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_auto_crop_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b873f0e65ac8608f7547c22f39943adda2772afcf8c805412d41ccdffd16d792 +size 270386 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_auto_crop_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_auto_crop_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5af17ec83d245327224499ddecfa73b02d6adf5f --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_auto_crop_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:19c01508511ede564117bb13f05cc69b88e2acf0eb0d6d56222f92bea83d1c31 +size 166305 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_auto_crop_v2_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_auto_crop_v2_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d1c95d4ff7c91f39308cb42c5407b47f23ee3330 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_auto_crop_v2_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a58e9fdcd7ef6346896215c9730879c942f3bdd7a89d1f5b32c419c2cd2674b +size 155630 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_auto_crop_v3_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_auto_crop_v3_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..12500d592d477589b8294532bd08d85404bc2607 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_auto_crop_v3_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4fbcc6556f08334d08d5953095a554cd78e7b8628378f2679e53085936bc0cb0 +size 105364 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_blend_advance_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_blend_advance_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e4cb4ad5f4fe94d50c95d46e11b1f35e6c6a88ea --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_blend_advance_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4aa3c2360331f43c4f3105205f6690fd1fc44ac59a72863dd53876b62f17403d +size 289180 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_blend_advance_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_blend_advance_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c768f905eaa98986baf205d66bbbdd4bdfc7bd30 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_blend_advance_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:84970d4c06b83130b3747c3a5278dbfedd68bdb2d23e23f6daa34a09806bcd1a +size 167996 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_blend_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_blend_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4ddf5de2255ff5328112044b32ac1bd3ccad8421 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_blend_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a12b5c777c48cfc065c7e5e0658b7e0f1dfdb92310a6ae38e41c4810ffeb284d +size 244283 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_channel_merge_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_channel_merge_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c2981e113d84383e2a1d3c5f5c905b676e5f57c4 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_channel_merge_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f74abf66a57a02fb05570c6643759f36d90f3ec602e323b3dc40dcddddb5c3f +size 227492 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_channel_split_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_channel_split_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d5c190d838f09b21227e1c199d18e5a48e0b453e --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/image_channel_split_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4b1fc13717290961574b60dcf2f5fccfadebc05b5ee15683b7d226c70eed5fe +size 138349 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/mask_by_different_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/mask_by_different_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fe2b6bb341d625fa983bdb1b63cc6fc6b9ded60b --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/mask_by_different_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:859f94e532fb35e3ab478fc90be05eaa378229773720608f2cbd39a112df43ff +size 125521 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/mask_edge_shrink_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/mask_edge_shrink_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..943b5342658d3fdfb8fd4aa20f3f4fdf70323bc5 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/mask_edge_shrink_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c3c8e26827a6d3b54340281c896a733eb8cd4c1158829e0afd33ccd4c1badd1 +size 101524 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/mask_gradient_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/mask_gradient_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2a2d34d4ff4219e10ad9adc595e8afecbb03bc28 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/mask_gradient_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e37a02487cb5317b30df6bcf46a9896a5e03f15f97de28d8d66dde1397a1ca3a +size 318668 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/mask_grow_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/mask_grow_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a4f45bd0c3bda8ec331e9496bbc815a600f3c6ba --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/mask_grow_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:afcd3d9ee7650e083a178980e1454bbed86f9856aaaf55a36d130c7a655a20e7 +size 125273 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/object_detector_yolo_world_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/object_detector_yolo_world_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f3d3264748a989d91a4e4608054f0532363538ad --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/object_detector_yolo_world_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15b39022a43f19834d0623a85eb70f0b197b8728a0a8738139acc1dfffd94ae9 +size 108807 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/outer_glow_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/outer_glow_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7bb7243261094b104995443ed7609920a81a1ede --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/outer_glow_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71a943888c6ded0aacc9525d5f9904b0e6f2c867b53af9b6c8a514e21e405e03 +size 149618 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/person_mask_ultra_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/person_mask_ultra_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6053ed593f9aeefe1d6abe1bc54f64cc7d69f555 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/person_mask_ultra_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d1a1c90588ad184ee5bb8a11a617039dde2d29b6a652b4e42d42108c5b967761 +size 265868 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/person_mask_ultra_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/person_mask_ultra_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f2496faf6f3c09e84e996cf745a30a737d1cd27b --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/person_mask_ultra_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3cb4ec5e1329c4d4aef3d11222b8d4d736263c4022b77f3726518129fcdfc3f2 +size 136144 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/phi_prompt_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/phi_prompt_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..de68725ddac465ef187ad80e3ecfd988ffccdf28 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/phi_prompt_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ac0a06c4d8f74c7dd99451521acee73b73e01a08d1cc34f7cdad96f922817aa +size 609917 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/phi_prompt_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/phi_prompt_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..885dcc857ecba63e821b237ad239a85b31455edf --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/phi_prompt_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f1a6e7d17e1187aa1ea03c24ea00879ca93097bd1cd98f7522ce71b9d5ae6ad +size 110305 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/pixel_spread_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/pixel_spread_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..87ff13eb96456e1c8fe20cc2a177464d1c4925a9 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/pixel_spread_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aeb7ad9798ffdebca83ca7153d79fdcd334b75c676889f712bfe6f9e1b146516 +size 229790 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/prompt_embellish_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/prompt_embellish_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d456400db5942f61f9b28e857a54bd9064e2c9a4 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/prompt_embellish_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99e7c5ee6d9d43af9fb69b378163670b8061f7688ce2767055624d8b0abd3b03 +size 171381 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/prompt_tagger_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/prompt_tagger_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f4f2e6d0525bd088a8fff664b2507f6d6dfa421a --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/prompt_tagger_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9e95f2da59000579cb6726979bcc9345c727efcbebd79e8ab01bfdc7fc7af5c +size 337946 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/prompt_tagger_example1.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/prompt_tagger_example1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1c07962355d6630ee820d836843f8674dad4342a --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/prompt_tagger_example1.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:156ad854380def7ef54b6211384fd2ed6646a93a60dcb5897965f0f08a69d2b6 +size 232880 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/purge_vram_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/purge_vram_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..aa33f623fe492ea4cc349daab30f35f8763e81e3 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/purge_vram_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8676d1ded68c1502292ef452a5b1cf716529a63268e9c0f44b87a09c6043a57 +size 122548 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/queue_stop_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/queue_stop_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c62820d3db23254f548b8cb09af5e26a7476d033 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/queue_stop_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2481d744547c21cdddafca2ecf3c2e5fedf4aee60573830fb1a64003580bd564 +size 102397 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/qwen_image2prompt_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/qwen_image2prompt_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..835868804c133120324e9cb0516ec30a96a311b1 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/qwen_image2prompt_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a8e7c675daaa8760b6a3cf0559c2cc8ef82d03cbcc7cc5860112c6aa680442d1 +size 166270 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/random_generator_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/random_generator_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..54158fe25ac0813ec5e18ea49557c2f8f7a41d39 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/random_generator_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d6d864ff78b219863f3407bb3a738bb52c3696d99c0a4a726c346e3143750d7 +size 370992 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/random_generator_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/random_generator_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ef2da312a30cec0882e2ded990c8a5a1e8ffb49e --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/random_generator_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8eda0b9fe9e65e31ca330d1e9c21adf1684da3eaf77b7b148fa7469e5018a78c +size 130888 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/random_generator_v2_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/random_generator_v2_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c6387e69c4a529e5472016c59a36c5099b8f8d4b --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/random_generator_v2_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e057091bb23445f02fdd2453ade67cf1fbd38493151d2a6e732432e2a740f25 +size 105368 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/rembg_ultra_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/rembg_ultra_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..962d02e5e0a6c073c6d23aebbd2887477170a399 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/rembg_ultra_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34d07f57d1aaec072b95ebecbad038e330513a83e0348f9f0aa5a31429123091 +size 444259 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sam2_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sam2_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0be42c1e25e6cf75252374ec1076de54d9344e97 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sam2_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dcc55213a211ed207d3f4d832606374266fa1114ebb37025c4d4d0259b1a61d9 +size 652061 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sam2_ultra_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sam2_ultra_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..264202731da17bea46a9f674964ac37fe2ce94c9 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sam2_ultra_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3cf8de876fa14ceb49d4f307e63af5468299e2d0b1b11c4c6dbbbf6221a750d0 +size 129365 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sam2_video_ultra_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sam2_video_ultra_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8d906ab4ae2520387a9432872cba577492b40dbc --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sam2_video_ultra_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fae811c63b2dbbb1c90db6f286db0c7bbc23fc000064f42912579dd7618ebaaa +size 164582 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/saveimage_plus_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/saveimage_plus_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4db530d55312dc17961744cd84f68af34b26c76d --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/saveimage_plus_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d696bea3482254dc789bb28187332fcfeb7dfd1c1028cd14a338fd508f70905 +size 134718 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sd3_negative_conditioning_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sd3_negative_conditioning_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f9cf8fd2ad7eacddf33dfbd4f7bd3c4be4c834f3 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sd3_negative_conditioning_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22055b60ba6b6084197ab884f3b92586b5a758b96d58d48a7b0d30206942422d +size 169159 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sd3_negative_conditioning_node_note.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sd3_negative_conditioning_node_note.jpg new file mode 100644 index 0000000000000000000000000000000000000000..db4a3303f04b0cfb5457c56dfa5ca39090f06ba7 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sd3_negative_conditioning_node_note.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf96d032f221cab32dad84b867f37a30b3a6a10bbd2ec9cd406d51a3018339eb +size 106326 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_clothes_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_clothes_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6169b9377fdcfeb7eff8ebd9ba63f7f912e87ab9 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_clothes_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38aa1fefb1d4fcf458aef0f9cc0148980fa93e9adf697ccb7a445986a4e2a82c +size 188037 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_clothes_pipeline_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_clothes_pipeline_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5af2866daab991e0cc4f56de9ca0977f7afd097c --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_clothes_pipeline_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e433f2eb360e1147bc17b729f2aa6a45671e58c72df41078fdb905eb9741913 +size 102560 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_fashion_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_fashion_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..87f58b7c8028567bbd7f2db3679232f561306a8d --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_fashion_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb19b7111c51d53b0ebca0395526b9ab5ad9250e50686e942aed4fd07c96cfb4 +size 216951 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_fashion_pipeline_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_fashion_pipeline_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..bb751904bb78c92af4e62e5ab508180527f879c7 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_fashion_pipeline_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4692f10872e005337d6c2c54141149ff017496d1d5e852635ae1951c38061d6 +size 182387 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_ultra_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_ultra_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e65cd92978347f82d2a91d4539287675ad10c36d --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_ultra_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2cefb3df2b8fd8a5115ea39994d1e742a708ccc9cbd7dbf8ed5b579c789b26e5 +size 175909 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_ultra_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_ultra_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..09a6cb9e2f3846265d2cb5a7284db3dd821b1df1 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segformer_ultra_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a2869435aad247a9ca6d81d84b976957dfaa27307eded039d8c10311eb134756 +size 102140 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segment_anything_ultra_compare.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segment_anything_ultra_compare.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ea0afe306021fa56d24b9f9b028e71f2af1e4d37 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segment_anything_ultra_compare.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3410f526f203f0ca7353b7a39f60f6c7b5e13a86b1857e99b28036c9764cf835 +size 264019 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segment_anything_ultra_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segment_anything_ultra_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f27f00d6013050f7b8cfe4979daa2950196e5533 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segment_anything_ultra_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d99dcd5ea4165455f8210c81e203b002680143433993d926f1cba7e39b5e4a9 +size 262563 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segment_anything_ultra_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segment_anything_ultra_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ef6c1f78b8ec6d55e872c891523b062c4302fdb6 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segment_anything_ultra_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f8f9c1d98b1cb22b07db63894c76417d7c738cb1e139771ace007536f6e739b +size 126428 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segment_anything_ultra_v2_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segment_anything_ultra_v2_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c66c156b1d4f06c09341b426fae6b1b419b884d4 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/segment_anything_ultra_v2_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:465c0af9680f558a72c5dfdd44a7a585b600a07dcf993b54cf65fb74c8ba3876 +size 166556 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/shadow_and_highlight_mask_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/shadow_and_highlight_mask_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4c7864505e072180682cece261263365149a8724 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/shadow_and_highlight_mask_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1e1b4ed80509b7e22ab2e50d821566f54d75b10f3ed0ebfe1e8fe1e4c491e59f +size 251532 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sharp_and_soft_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sharp_and_soft_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b81ccb75248d54c0d76fe89be4ad046421810ca5 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/sharp_and_soft_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa7f3bf31f2d27eb2b9ff130d0a39b419f215d454f1711e2a6df9a16a68450b0 +size 293791 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/simple_text_image_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/simple_text_image_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fa01a63630a949014650c3092461191d36739250 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/simple_text_image_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:847479f66a42560f513e7a586252073b35ac67fc82bfae3a19d2b4ae4d4185e9 +size 362969 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/simple_text_image_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/simple_text_image_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..42fb0d3077eafdc72a43a168539a2bbd838aa6fc --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/simple_text_image_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c617fa8c395c89cb2f8ff61ff4f392b7f3798129256f0aa1d67817d5f96f9e94 +size 136323 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/skin_beauty_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/skin_beauty_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e8845e1545358c210eaab355774e5a040f38301e --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/skin_beauty_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:111421e70e9a4aff044f08349d84c49a61145f020b3e7695c8b2979e1835c055 +size 181458 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/soft_light_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/soft_light_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c3470469f1269750716f6fff8b688f462a5e0e8e --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/soft_light_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d820edc138a8345d44e093e307692af425d258608982cc9ce4c14930f73501bb +size 158617 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/string_condition_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/string_condition_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..603b8438c2e232fc75e3c95c527af5d254a0b444 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/string_condition_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c2b284654b47c59405b6ec89cbdbb10abee4e3ce140aa56f413096753b837ea +size 123855 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/stroke_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/stroke_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..13059f5932bdcb92b641baabe67e37de3c8538d6 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/stroke_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc589920447074ae36e8fac861577277d9521d5ee8af3d82f0e6b0ac681574cb +size 138205 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/switch_case_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/switch_case_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..802e24286f0190c86e45624b71a7b875844754da --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/switch_case_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d9a84dd8df78c26bb354bc2594641da9971b15fcdbd520558358b328a91a9242 +size 185706 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/text_image_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/text_image_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0a80b50bfa9a73a5899c218dbc28369c771ae4bd --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/text_image_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8dc32ac555d14c9152dcd9d0ae27ffbc6e3430777597eacd6e3f52ddce20c6a9 +size 277353 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/text_image_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/text_image_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5405bb0e9b632254bf774edb44b79716ee578559 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/text_image_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:373b98de9a1e365a864b2b42e040801a6e904211268276d9599061146cadc24f +size 230645 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/text_image_v2_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/text_image_v2_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..124250c9136b0a89f098a2aadb55302e2c76bd96 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/text_image_v2_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef350e864a663586badcd69d7ee91dfe41cecc049f7f5ff45a45b6ae41d56f9a +size 131487 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/text_join_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/text_join_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a4cd314ea07ac2459f4c8d4a530e7386435f1b49 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/text_join_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:342535a6b243daa1d5a17632975c3ecf569c0ff0598ddaee11ed5d66f52828f1 +size 106731 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/title.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/title.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0150468a8aee2f5f80bb05a7ab90e108218593a1 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/title.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e40e4d443afea6f26d19ece7dc7118df687f000b39c191dd567480eb77a53c37 +size 392262 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/transparent_background_ultra_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/transparent_background_ultra_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..257f546ab829d435cc07d72ec150142e1839e604 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/transparent_background_ultra_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0af701b5166fb9ae6c58ff6b3c59448184b20fcfdb599a31082526780d01f497 +size 137055 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/ultra_nodes.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/ultra_nodes.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d17dd924482cfa7e6e59c39ac9cf3c042a435fb0 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/ultra_nodes.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e5bfb8abeba08ac978013b56fa7b684ea597bf31a94be6e0c3098f8ce0939856 +size 194763 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/ultra_v2_nodes_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/ultra_v2_nodes_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ee8222a962e5dcdbb9518368431a720b43accbde --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/ultra_v2_nodes_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:96d3e897907bbe066d63a77e504c91bbe10dbdade8c85af830a026b935386b88 +size 330442 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/userprompt_generator_txt2img_with_reference_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/userprompt_generator_txt2img_with_reference_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..139e2d1ab8f760169ccb5f41f9e864164fa67f60 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/userprompt_generator_txt2img_with_reference_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d2250a9635f67f329432d8d41d7fb2cc174726ac2e81a1332885a4a053937be0 +size 106290 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/vqa_prompt_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/vqa_prompt_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0576a922a5f8208842f98cdf8c4ab2bca83a51ff --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/vqa_prompt_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4195f755470f72c094cbea251b280f2797a391689d4d223e56f2cc8f6673122 +size 232045 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/vqa_prompt_node.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/vqa_prompt_node.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a7c02edd38d7aac06202c0307e3754ea483df52f --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/vqa_prompt_node.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:180b7662e7daf76388e79c6facb6561ca6974481857ed1ef06261a1c18c13819 +size 116402 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/water_color_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/water_color_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..78a38a185c21a517472b8fd7d85443a72e39433d --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/water_color_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:271a9f9e09cbcc6afb13f9444f2e7b5c338c5ac39c786fb963f84188b977ae03 +size 149740 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/watermark_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/watermark_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e997546861b14a5557e57cdd1ebd7f2150c08ab5 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/watermark_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a17bedf11dd802838d98100e193b2f7f39496f60993fe735423e52ca15a1b61e +size 217797 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/xy2percent_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/xy2percent_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b253f95a72e4019bc706e286c326ae91d577189d --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/xy2percent_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:75044fbeab6a4969ad115b6ab0b354cf6548bf4637ee4dcf54a0a2e458119251 +size 288864 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/yolov8_detect_example.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/yolov8_detect_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f53576a6e10a3d5a4c345624ef11c69a14d2d6d5 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/image/yolov8_detect_example.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4d589e83913633114e7c2ff91b2c1997ac16559b1e337721be916f2718f181d +size 250831 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Black-jiII8dog.woff2 b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Black-jiII8dog.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..b6f300ba32dcb059b966578f86e1581adc8ebc33 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Black-jiII8dog.woff2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa867fe6d7113966e6edc71acc1d03dc57f26cad1de2621c4ae1525e07966005 +size 108748 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-BlackItalic-1413vuen.woff2 b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-BlackItalic-1413vuen.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..6c4e15a7bf9e7246a25e61f62fc971a59ee807e3 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-BlackItalic-1413vuen.woff2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4b50bf8326f73ec4636c40bbbb8b2df2023340dd67b1fca1aa5f83fed71259d1 +size 115364 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Bold-srYz_-1B.woff2 b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Bold-srYz_-1B.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..cdb746bc529d716bb0d204bc1b103ecbec5c603d --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Bold-srYz_-1B.woff2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:220976705fbec109f43c5cfdceca639e99ace7e51f3eb67292b105d3575eb39b +size 111040 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-BoldItalic-dE_gZyur.woff2 b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-BoldItalic-dE_gZyur.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..237102f11afecf051c267dddbaa42758af0727cd --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-BoldItalic-dE_gZyur.woff2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af46bd584de8bb0aabfdab5c8651f943b089d09959ba30ae75454689c56f3bd2 +size 118392 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-ExtraBold-TduDdwUu.woff2 b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-ExtraBold-TduDdwUu.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..83486664d23dc70800ebe1800e11501e6f64261b --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-ExtraBold-TduDdwUu.woff2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98023dd780794f5f7f580bb0e8ca24591bc45f44f31c2c39bfd146c1d104cc4f +size 111360 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-ExtraBoldItalic-BJafRE5I.woff2 b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-ExtraBoldItalic-BJafRE5I.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..5987daab906c5273f48b59006e20fab0c1c50862 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-ExtraBoldItalic-BJafRE5I.woff2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe47bb9ab345364432351e8dcb831cadddcf3013f33d97316723be4a24dea334 +size 118604 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-ExtraLight-w5HAp5iF.woff2 b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-ExtraLight-w5HAp5iF.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..3e72fc2c6817ff026ac98dce30a25ef31383cdd4 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-ExtraLight-w5HAp5iF.woff2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6c261b852a5d2f8dec6925ea8881d6786b91598866ae4c4b27d931bedc4325e +size 110176 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-ExtraLightItalic-ZptecSuc.woff2 b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-ExtraLightItalic-ZptecSuc.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..d7cf0787d0c50fffaf72503ae9e3a0fe60eb5d6a --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-ExtraLightItalic-ZptecSuc.woff2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47608eb39ed9fef3239ccea678a7de838c8e7ee156217c0ecd5a6e1fabfbf3c4 +size 116296 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Italic-f6M78thn.woff2 b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Italic-f6M78thn.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..8516a2406b32057720e3b36e9de3cc68ca7a03c2 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Italic-f6M78thn.woff2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:708b7baa59a80d80465229b74f1dcb599d3ee76515a93d304337b92efb964afe +size 114576 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Light-DFhX0qo-.woff2 b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Light-DFhX0qo-.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..d104fb9ad35cee4c19ccaff7eea9b69c11fdea9f --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Light-DFhX0qo-.woff2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d12f464576228dc3879b30775fafe389472bdf021d2d11cea365ccb997ca6c51 +size 109992 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-LightItalic-fu56_DRc.woff2 b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-LightItalic-fu56_DRc.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..22cbd0fe98b89733a920f87f9bc9b2fb0379ebad --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-LightItalic-fu56_DRc.woff2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72319cf2f5403460dd70d02e10fca39a8d6bfde2901c5be3b57fcf8cdd7c26f7 +size 116516 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Medium-dDRaJ8tM.woff2 b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Medium-dDRaJ8tM.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..1bc6931f14bfa675e5318dee993e06751dc1b8ad --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Medium-dDRaJ8tM.woff2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8458f8afa67b5691c1fcbe51607a2dafb53a9839e48131c608a186b65415d96d +size 111380 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-MediumItalic-zr3roggP.woff2 b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-MediumItalic-zr3roggP.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..e2595c61c8a375356a756f295febea87e07bf94d --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-MediumItalic-zr3roggP.woff2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f4481b062ed1cf93cd72d7e3731e49f28f0db980f0f9b06db170a75316548f1 +size 118392 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Regular-dEFHw1tF.woff2 b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Regular-dEFHw1tF.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..f6de211613a954174bdc3b2b1455782f41940c7e --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Regular-dEFHw1tF.woff2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6f9db9e45be20f3c1312c97fbee7ec36b7d8280f8caa4d53c9ba0408cc9997a +size 108488 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-SemiBold-PyS8DO2L.woff2 b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-SemiBold-PyS8DO2L.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..28b1b44115dd7d45dce750fd6d353d009f906fb8 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-SemiBold-PyS8DO2L.woff2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e52a861dc26ff4608c50bd7ff89b65d0d6216a2afe7b47ce5d84544811ca400 +size 111588 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-SemiBoldItalic-uIDb7hsH.woff2 b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-SemiBoldItalic-uIDb7hsH.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..d94b2376e54168edd39d4723e2eb92f63cf4973e --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-SemiBoldItalic-uIDb7hsH.woff2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8789e3e4f2cb727ad4cecbcf8cd289011e56cad1b65690828c67deb76534807b +size 118216 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Thin-eKObIkJC.woff2 b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Thin-eKObIkJC.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..28c6dbb08abbb22a9b9c9089e572bba6b1c82718 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-Thin-eKObIkJC.woff2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ab12bc9c828b7d0441b8e55141ad9f7bdfb8f1e32178d6216d8d4395b7abf4c +size 106620 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-ThinItalic-L6uBn3RP.woff2 b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-ThinItalic-L6uBn3RP.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..a9002fe1f009cb7e7476df20ff35861894b5fc56 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/Inter-ThinItalic-L6uBn3RP.woff2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e5555942ce99d0b615e805c0d0113d7807551dc66227c3b669c5ea640b26ebf4 +size 113384 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/kofi_button_black-XI_Dr2zg.png b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/kofi_button_black-XI_Dr2zg.png new file mode 100644 index 0000000000000000000000000000000000000000..f949581897cdd7d754151db49c8c3c3632480ae6 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/iopaint/web_app/assets/kofi_button_black-XI_Dr2zg.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d6ce4ea404428eb378aa97574100451af73040cf0b86b8db0b7a0ebaefc1686 +size 207929 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/whl/hydra_core-1.3.2-py3-none-any.whl b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/whl/hydra_core-1.3.2-py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..7f7843e1c3e600afb4a9fac566dae0cf9a81df3f --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/whl/hydra_core-1.3.2-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa0238a9e31df3373b35b0bfb672c34cc92718d21f81311d8996a16de1141d8b +size 154547 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1280x768_city.png b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1280x768_city.png new file mode 100644 index 0000000000000000000000000000000000000000..c8bd7d3fe1fde0262f316628963595405a7cf5d7 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1280x768_city.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e15fc79c37868a42b4633691daced6395e607fc0e2b6db24060fe3e1f493bd31 +size 1608184 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1344x768_beach.png b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1344x768_beach.png new file mode 100644 index 0000000000000000000000000000000000000000..b34c7bca048b812ca497a9222f1d8835b392a90e --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1344x768_beach.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f24c38281bb94f1c33ce36043cb8d76988da4c38de4072a58606a8f222606096 +size 1155964 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1344x768_girl2.png b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1344x768_girl2.png new file mode 100644 index 0000000000000000000000000000000000000000..3f0b86dda63c6ed76d7776a403a464cc849849ad --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1344x768_girl2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a74a9ccdb2ad9f13b153f80ba468a22960924a1893986046df3252b81480689 +size 911172 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1344x768_hair.png b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1344x768_hair.png new file mode 100644 index 0000000000000000000000000000000000000000..05680c40f513d5bdee56ee1a4aa3c2b5b98f1af2 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1344x768_hair.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af7b15eddc78f69f1a57e1fc06a6b4aeca8125304f1609d0807b32c83e10adbe +size 1109656 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1344x768_redcar.png b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1344x768_redcar.png new file mode 100644 index 0000000000000000000000000000000000000000..d85c37e07137a5f66c6f1a6eefdac3866c5ed2bb --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1344x768_redcar.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9cc37bd5b1a037a8e6c7f2f7cb95fd06720789c1150eed4c10635ce3c869a735 +size 975009 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1920x1080table.png b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1920x1080table.png new file mode 100644 index 0000000000000000000000000000000000000000..d70b1abc5e341d0a13b374b811f155a67577cbf5 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/1920x1080table.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ae555a67113c4ca826ad47032761690b0027f936f0241ab19e2b29cbbcb03c9 +size 624815 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/3840x2160car.jpg b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/3840x2160car.jpg new file mode 100644 index 0000000000000000000000000000000000000000..696b3aade76d4d5b9d39b999e978549d0ad74771 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/3840x2160car.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9911c55012668f5372db9b0724b39ef63bc28f2b970b231ba3c4d92beb791f99 +size 396098 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/512x512.png b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/512x512.png new file mode 100644 index 0000000000000000000000000000000000000000..d1751a730ec1ffaac00d9bd96b296068681ea8ce --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/512x512.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e365fab7ab0d1093082e989ce83140dc2bb5e3df6e3ae06d57805b9d9b536574 +size 129720 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/768x1344_beach.png b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/768x1344_beach.png new file mode 100644 index 0000000000000000000000000000000000000000..1e1b5a652dc93259b56ef1feb9ad6406437080eb --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/768x1344_beach.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24e35250b912ef741d8c9fca5d3332fa2073ea090e7e2a865a58152a21cf997c +size 1120132 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/768x1344_dress.png b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/768x1344_dress.png new file mode 100644 index 0000000000000000000000000000000000000000..04c8b7aa6e589edf48bd29f24de832d2caa338a7 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/768x1344_dress.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ccb884ac59e9154d348a6026438d7598256cdf923331e6b4f4b08749e8a63aa8 +size 1129534 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/fox_512x512.png b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/fox_512x512.png new file mode 100644 index 0000000000000000000000000000000000000000..7f0e2ce9a313719b1d9d5ec88bde362500bb8a31 --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/fox_512x512.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1eade898ff9a30dd1d1264f8901e5b3f66bd53135c31fb4e0d8ebae1a5a31179 +size 362483 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/girl_dino_1024.png b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/girl_dino_1024.png new file mode 100644 index 0000000000000000000000000000000000000000..97a88a693e8af8fd3b7346931ee75bf6650b8a8e --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle/workflow/girl_dino_1024.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c6a56b8a246fa3efe97e83c88c5ac43e5106d71ef6ae779320158dc1cf3cfa3 +size 1036673 diff --git a/ComfyUI/custom_nodes/ComfyUI_LayerStyle_Advance/workflow/1344x768_beach.png b/ComfyUI/custom_nodes/ComfyUI_LayerStyle_Advance/workflow/1344x768_beach.png new file mode 100644 index 0000000000000000000000000000000000000000..b34c7bca048b812ca497a9222f1d8835b392a90e --- /dev/null +++ b/ComfyUI/custom_nodes/ComfyUI_LayerStyle_Advance/workflow/1344x768_beach.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f24c38281bb94f1c33ce36043cb8d76988da4c38de4072a58606a8f222606096 +size 1155964 diff --git a/ComfyUI/custom_nodes/comfyui-impact-pack/example_workflows/2-MaskDetailer.jpg b/ComfyUI/custom_nodes/comfyui-impact-pack/example_workflows/2-MaskDetailer.jpg new file mode 100644 index 0000000000000000000000000000000000000000..198296605d5d51654e9997a87b1536a8fa632ff3 --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-impact-pack/example_workflows/2-MaskDetailer.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1abd1823bed26d5e8c92707c0369d41b4f7c6a0629e70c3fa92fcc914585dc8a +size 114261 diff --git a/ComfyUI/custom_nodes/comfyui-impact-pack/example_workflows/4-MakeTileSEGS-Upscale.jpg b/ComfyUI/custom_nodes/comfyui-impact-pack/example_workflows/4-MakeTileSEGS-Upscale.jpg new file mode 100644 index 0000000000000000000000000000000000000000..307f1959556bbbfe8e117b3f31e9b9867eaff30d --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-impact-pack/example_workflows/4-MakeTileSEGS-Upscale.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b1d3d9a3563821ba82a6277610e83ec2fe20473679ebb25c70c811a252e06ecd +size 108834 diff --git a/ComfyUI/custom_nodes/comfyui-impact-pack/example_workflows/5-prompt-per-tile.jpg b/ComfyUI/custom_nodes/comfyui-impact-pack/example_workflows/5-prompt-per-tile.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5b5447c266791208d4e2246cbac098480d3e1179 --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-impact-pack/example_workflows/5-prompt-per-tile.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:232bde22503e087e47c391bb91bbcc830c9882889ac715c1ec139667ea3d2c03 +size 130918 diff --git a/ComfyUI/custom_nodes/comfyui-impact-pack/example_workflows/6-DetailerWildcard.jpg b/ComfyUI/custom_nodes/comfyui-impact-pack/example_workflows/6-DetailerWildcard.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0e33a8423593abf7d41e5e8ce7975abbe7ba060c --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-impact-pack/example_workflows/6-DetailerWildcard.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f80a2add23387329e86abfb00382d1efd818df33a8fa19c93cdf75a478a491df +size 538538 diff --git a/ComfyUI/custom_nodes/comfyui-impact-pack/troubleshooting/black1.png b/ComfyUI/custom_nodes/comfyui-impact-pack/troubleshooting/black1.png new file mode 100644 index 0000000000000000000000000000000000000000..fab0a221281c4b35edb935e4888fadd726598ea0 --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-impact-pack/troubleshooting/black1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e32fe1606d35a26ddf08d2a3ff24c8fcd62831b9ed11eeaa76468e27a2b5f0f +size 752880 diff --git a/ComfyUI/custom_nodes/comfyui-impact-pack/troubleshooting/black2.png b/ComfyUI/custom_nodes/comfyui-impact-pack/troubleshooting/black2.png new file mode 100644 index 0000000000000000000000000000000000000000..1441941a0dae5a1ed105e6db6b1b35356b054524 --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-impact-pack/troubleshooting/black2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:829d72c3cc1034f72bbd0945e1a2aed69e1f38060126159c0b911c4c102e2fcc +size 709592 diff --git a/ComfyUI/custom_nodes/comfyui-inpaint-cropandstitch/example_workflows/inpaint_flux.jpg b/ComfyUI/custom_nodes/comfyui-inpaint-cropandstitch/example_workflows/inpaint_flux.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3e2eda0dd0af386d332ddf5f3c9a441f50dce291 --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-inpaint-cropandstitch/example_workflows/inpaint_flux.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:655e62171d500de349a5a0c8758da222a67c08ca5697ded546867845d4341e1c +size 991434 diff --git a/ComfyUI/custom_nodes/comfyui-inpaint-cropandstitch/example_workflows/inpaint_hires.jpg b/ComfyUI/custom_nodes/comfyui-inpaint-cropandstitch/example_workflows/inpaint_hires.jpg new file mode 100644 index 0000000000000000000000000000000000000000..19fa712d322cf618d32a94b1739392704e94796b --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-inpaint-cropandstitch/example_workflows/inpaint_hires.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df3e820326e9fbc73fd042cdccc06f76509feaa0863295775487ef64972ca827 +size 337844 diff --git a/ComfyUI/custom_nodes/comfyui-inpaint-cropandstitch/example_workflows/inpaint_sd15.jpg b/ComfyUI/custom_nodes/comfyui-inpaint-cropandstitch/example_workflows/inpaint_sd15.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fd5486747fcacc8949dee60d95cc904b8889accd --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-inpaint-cropandstitch/example_workflows/inpaint_sd15.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1516d218696f88cd52bee1908ed1ea02ce3cdac15a109b5d151b0e167e876482 +size 558727 diff --git a/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/inpaint.png b/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/inpaint.png new file mode 100644 index 0000000000000000000000000000000000000000..9f52159a72aaa1a8b63282b1ae73e72d909db8e1 --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/inpaint.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e8812163c8332ef000e2d1ab6213e46bc55ae1e3b63454b6fb43deeccf61e25a +size 1002549 diff --git a/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-blur-17.png b/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-blur-17.png new file mode 100644 index 0000000000000000000000000000000000000000..e432c72370202d75c1485b338f9532997377c206 --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-blur-17.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:472304492a1974d25a6d80ca72176203cff94b620d0ec29252be8823e595a878 +size 429431 diff --git a/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-blur-65.png b/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-blur-65.png new file mode 100644 index 0000000000000000000000000000000000000000..82d8b9a47bdb0ada11dacea77081ae67ce2ecd98 --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-blur-65.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99716d76e7b48266ea222d527d3f7a9138477e626e2b1decf9097b5b0da2cf1b +size 430940 diff --git a/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-input.png b/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-input.png new file mode 100644 index 0000000000000000000000000000000000000000..39aeef35d2375448faf8b7a4c46868fa8284d15f --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-input.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e9b0210ad1f6907adbe41017aa393690391ed5a176691c264b567e76165bb8d +size 483710 diff --git a/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-lama.png b/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-lama.png new file mode 100644 index 0000000000000000000000000000000000000000..29b84fabc5c18613ad61592dddffa54a2786a0eb --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-lama.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:134733cee34a8b39959cb705d641e05206591d0a037c03aad58a95bfbdcd9d2e +size 441788 diff --git a/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-mat.png b/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-mat.png new file mode 100644 index 0000000000000000000000000000000000000000..50dc73587808fec0b259833d3b800917ce051bef --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-mat.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eda300c0a52c078806eed3a1fec4136b2ad81f1a5db29dd92785d8787efc5e9b +size 449135 diff --git a/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-navier-stokes.png b/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-navier-stokes.png new file mode 100644 index 0000000000000000000000000000000000000000..fe90219d987bd76d6f22874a2cec819706e00ce3 --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-navier-stokes.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:109b69d28cfaf0519101145c07f9ffd26ffe167c017cdfa5286b64faf0d9669f +size 423801 diff --git a/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-neutral.png b/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-neutral.png new file mode 100644 index 0000000000000000000000000000000000000000..c7bb0eb31f5018b6d3ab958e1635cbe2fb8ef2ea --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-neutral.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9ac8568610fa5db89634553962b928f02a74bb4a93979e112bddd5f8d5fba29 +size 417964 diff --git a/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-telea.png b/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-telea.png new file mode 100644 index 0000000000000000000000000000000000000000..3f0e1ac5be9d9260e4fc020ac994ea56baf38d07 --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-inpaint-nodes/media/preprocess-telea.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f01491b3dcff105499a1b83b6ddfe1467c13fbaea4a72f74eec29d6e6af8bc7 +size 441439 diff --git a/ComfyUI/custom_nodes/comfyui-kjnodes/docs/images/2024-04-03_20_49_29-ComfyUI.png b/ComfyUI/custom_nodes/comfyui-kjnodes/docs/images/2024-04-03_20_49_29-ComfyUI.png new file mode 100644 index 0000000000000000000000000000000000000000..b42cfe56374c6db142326761a2a3d96211519664 --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-kjnodes/docs/images/2024-04-03_20_49_29-ComfyUI.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85805d3c7ca8f5d281886ea0ad61f9a78edad755ef8014b3870f91b871807ac9 +size 176158 diff --git a/ComfyUI/custom_nodes/comfyui-kjnodes/fonts/FreeMono.ttf b/ComfyUI/custom_nodes/comfyui-kjnodes/fonts/FreeMono.ttf new file mode 100644 index 0000000000000000000000000000000000000000..1e35d08261b9a61f87b6f1e7393d5c1221828ed1 --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-kjnodes/fonts/FreeMono.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7c692ad545c308b7b8fc2db770760c4a5d15ca50f12addf58c8f5360370e831 +size 343980 diff --git a/ComfyUI/custom_nodes/comfyui-kjnodes/fonts/FreeMonoBoldOblique.otf b/ComfyUI/custom_nodes/comfyui-kjnodes/fonts/FreeMonoBoldOblique.otf new file mode 100644 index 0000000000000000000000000000000000000000..3aafa30ff9d9f31df006993f3c3d5c2eb5953f4f --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-kjnodes/fonts/FreeMonoBoldOblique.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:96187651ee033d0d9791dc2beeebfba5d1f070ab410fce1a5c16483ca249c588 +size 237600 diff --git a/ComfyUI/custom_nodes/comfyui-kjnodes/fonts/TTNorms-Black.otf b/ComfyUI/custom_nodes/comfyui-kjnodes/fonts/TTNorms-Black.otf new file mode 100644 index 0000000000000000000000000000000000000000..2cd91a4fc9637af834c5e2793ab6487c5067063d --- /dev/null +++ b/ComfyUI/custom_nodes/comfyui-kjnodes/fonts/TTNorms-Black.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:710977e683bf0db6416d6d41b427e0363c914e6c503a5291fcb330f30b8448ea +size 152736