
    ?Hj&                     0   d Z ddlZddlZddlZddlmZ ej                  j                  d e ee	      j                               ddlZddlZej                  dz  ZddgZdZdj'                  g d      Zd	efd
Zd ZddgZd Zd Zedk(  r e        yy)u  s5 — 2라운드: (A) 실외 sketch-hop-before-plate, (B) 마네킹 인물샷 재검.

A. wide/무인물 establishing 한정: root_marked → eye-level LINE-ART camview 스케치
   → photoreal empty plate → (S4_Shot1 만) temp→VLM→bg→final (B 경로, v2 계약).
   산출: out/outdoor_v3/<sk>/
B. 마네킹 효용: 인물 샷 2개 — 실내 S5_Shot3(기존 contour 재사용),
   실외 S11_Shot3(v2 contour 재사용) 에 bg_C_m + final_C_m 추가.

사용: .venv/bin/python s5_round2.py [--only hop|mannequin]
    N)Path
outdoor_v3S4_Shot1	S10_Shot6
)zKThe attached image is a TOP-DOWN aerial site sketch of one real place, withzEa green camera icon and view-cone marking ONE camera position and itszCviewing direction (circled letters are site markers, never people). zJDraw the clean LINE-ART sketch of the EYE-LEVEL view that THAT camera seeszJfrom its marked position: thin dark ink lines on a plain white background,zKno colour, no shading, no photo texture. The camera stands ON the ground ofuJ   its marked spot at human eye height (about 1.6 m) INSIDE the scene — NOTzKabove it. Show the structures, ground surfaces, openings and approaches thezEsite sketch places in front of that camera, in correct perspective atzGreal-world human scale, with the horizon at a natural eye-level height.zCDo NOT draw any overhead or bird's-eye view. No people, no text, nouH   letters, no circles, no arrows — pure line drawing of the environment.returnc                 4   | d   D cg c]  }|d   |d   v s| }}dj                  d |D              }dj                  dddd	d
ddddddd|ddt        |j                  dd            dt        j                  |      dt        j
                  g      S c c}w )Nmembersloc_idloc_idsr   c              3   h   K   | ]*  }d |j                  d       d|j                  d        , yw)z- labelz: summaryN)get).0ms     s5_round2.py	<genexpr>zplate_prompt.<locals>.<genexpr>+   s1     RTBquuW~.by1A0BCTs   02zGThe FIRST attached image is a LINE-ART sketch of one camera's eye-leveluF   view of a real outdoor place — it is the COMPOSITION AND PERSPECTIVEzFground truth. The SECOND attached image is the top-down site sketch ofuD   the same place — use it ONLY to understand materials, fixtures andzDspatial relations; never copy its top-down viewpoint or its markers.r   zHRender the PHOTOREALISTIC empty background plate of exactly the view thezGline-art sketch shows: same framing, same perspective, same structures,zFat real-world human scale. This is an EMPTY plate: no people, no text,uF   no letters, no circles, no sketch lines — pure photographic realism.z-WHAT THIS PLACE LOOKS LIKE (production data):zSite orientation notes:sketch_notes)joinstrr   Cstaging_linesEYE_LEVEL_CONTRACT)recons	root_planr   locs	loc_liness         r   plate_promptr!   )   s    Y'G'!1X;!I,+FA'DG		RTRRI99QPPNN
RQPP
7
!3y}}^R'H#I
AOOAA$8$8!   Hs
   BBc           	      .   t         D ]  }| d   |   }t        |z  }|j                  dd       t        j                  dz  |z  dz  }|dz  }|j                         st        j                  ||       t        j                  | dt        |g|dz        }t        j                  | d	t        | ||      ||g|d
z        }|t        k7  rt        j                  |      t        j                  t        j                  g}	t        j                   | |      }
t        j"                  | d||||dz  |	      }t        j$                  |dz   |      }t        j&                  | d|||dz  ||	      }t        j(                  | d|||
|dz  |	        y )NshotsT)parentsexist_okoutdoorzroot_marked.png_camview_sketchz
sketch.png)refsout_path	_plate_v3	plate.png_temp_v3ztemp.png	contracts_v3_bgB_v3zbg_B.png)compr.   _final_B_v3zfinal_B.png)	HOP_SHOTSV3mkdirFOUTexistsshutilcopyfileimg_gptSKETCH_PROMPTr!   FULLCHAIN_SHOTr   people_contractMARKER_NOT_PEOPLEr   passports_for_shot	temp_shotvlm_compositionbg_regen
final_shot)r   r   skr   dsrc_markmarksketchplater.   	passportstempr1   bg_bs                 r   hoprN   @   s   i'N2G	t,559$r),==$${{}OOHd+bT1=v$%$46		RD	*L9,M &~KI&&q)1+>+>))+	((2	{{bT?AudA
N%.0  eT2zzRD.!UA
N$-/	t;'D)Q=N(	*-     )indoorS5_Shot3F)
outdoor_v2	S11_Shot3Tc           
         t         D ]I  \  }}}| d   |   }t        j                  |z  |z  }|dz  }|j                         s t        j                  ddd| d| d       [|j                  d      r|d	z  nGt        j                  d
z  dz  t        d      j                  t        j                  d      |       dz  }|r4t        j                  |      t        j                  t        j                  gnd }t        j                  | |      }	t        j                  | d|||dz  |d|      }
t        j                  | d||
|	|dz  |       L y )Nr#   zcontour.pngwarns5zno contour /)kindstagemsgr&   r+   rP   
top_layers	s2_indoorindoor_planz.png	_bgC_m_r2z
bg_C_m.pngT)contour_png	mannequinr.   _final_C_m_r2zfinal_C_m.pngr-   )MANNEQUIN_TARGETSr6   r7   r8   runlog
startswith
__import__assigned_top	load_planr   r>   r?   r   r@   rC   rD   )r   lanerE   use_contractsr   rF   contenvr.   rK   bg_ms              r   r`   r`   a   sX   #4#4b-'N2EEDL2= {{}HHftk$qQSPT<UVW#'??9#=q;EEH|++&33AKK4NPRSTTXYZ 	 0= ''*A,?,?**,BF 	((2	zzRD	*AsA4D&*diQ	t=)1dI(I	? $5rO   c                  v   t        j                         } | j                  ddg d       | j                         }t	        j
                         }t	        j                  d      }|j                  dv rt        ||       |j                  dv rt        |       t	        j                  dd	|j                  d
       y )Nz--onlyall)rn   rN   r`   )defaultchoicesr   )rn   rN   )rn   r`   rY   	s5_round2)rX   rY   done)argparseArgumentParseradd_argument
parse_argsr6   
load_reconrg   onlyrN   r`   rc   )apargsr   r   s       r   mainr{   u   s    		 	 	"BOOHe5POQ==?DLLNEK(IyyN"E9yy((%HHgTYYGHrO   __main__)__doc__rs   r9   syspathlibr   pathinsertr   __file__parent
forest_libr6   forest_chainr   r7   r4   r3   r=   r   r<   r!   rN   rb   r`   r{   __name__ rO   r   <module>r      s   	   
  3tH~,,- .  UU\%			  " .*8 "% ?(
I zF rO   