Files
AVM360/py_utils/__pycache__/coco_utils.cpython-38.pyc

51 lines
5.7 KiB
Plaintext
Raw Normal View History

2026-04-01 14:11:47 +08:00
U
<00>
<EFBFBD>i;<00>@sTddlmZddlZddlZddlZddlZGdd<04>d<04>Zdd<06>ZGdd<08>d<08>ZdS) <09>)<01>copyNc@seZdZdd<02>dd<04>ZdS)<05>Letter_Box_InfoN<6F><01>returncCs.||_||_||_||_||_||_||_dS)N)<07> origin_shape<70> new_shape<70>w_ratio<69>h_ratio<69>dw<64>dh<64> pad_color)<08>self<6C>shaperrr r
r r <00>r<00>&/home/ztl/LJ360/py_utils/coco_utils.py<70>__init__szLetter_Box_Info.__init__)<04>__name__<5F>
__module__<EFBFBD> __qualname__rrrrrrsrc Cs<>ddlm}ddlm}||<00>}|<04>|<01>}|||d<04>}|<06><05>|<06><06>|<06><07>|jdd<05>\}}t d|<07>t d|<08>t d|jd<00>t d |jd
<00>t d |jd <00>dS) Nr)<01>COCO)<01>COCOeval<61>bbox<6F>z map --> z map50--> z map75--> z map85--> <20><><EFBFBD><EFBFBD><EFBFBD>z map95--> <20><><EFBFBD><EFBFBD><EFBFBD>)
Zpycocotools.cocorZpycocotools.cocoevalrZloadResZevaluate<74>
accumulateZ summarizeZstats<74>print) Z anno_jsonZ pred_jsonrr<00>annoZpred<65>eval<61>mapZmap50rrr<00>coco_eval_with_jsons  
 

r c@sTeZdZddd<03>dd<05>Zddd<08>Zdd d
<EFBFBD>Zdd d <0A>Zdd<0F>Zddd<11>Zdd<13>Z dS)<19>COCO_test_helperFNrcCs(g|_||_|jdkrg|_nd|_dS)NT)<03> record_list<73>enable_ltter_box<6F>letter_box_info_list)r <00>enable_letter_boxrrrr(s

zCOCO_test_helper.__init__<5F>rrrc
Csj|jdd<01>}t|t<02>r ||f}t|d|d|d|d<00>}|}tt|d|<00><01>tt|d|<00><01>f}|d|d|d|d} }
| d} |
d}
|ddd<04>|kr<>tj||tjd<05>}tt|
d<00><01>tt|
d<00><01>} } tt| d<00><01>tt| d<00><01>} }tj|| | | |tj |d<07>}|j
dk<08>rJ|j <0B> t ||||| |
|<03><07>|dk<08>rb||| |
ffS|SdS) Nrr<00>r<00><01> interpolationg<6E><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?)<01>valueT)r<00>
isinstance<EFBFBD>int<6E>min<69>round<6E>cv2<76>resize<7A> INTER_LINEAR<41>copyMakeBorder<65>BORDER_CONSTANTr#r$<00>appendr)r <00>imrr <00> info_needr<00>rZratioZ new_unpadr
r <00>top<6F>bottom<6F>left<66>rightrrr<00>
letter_box0s&
"(""" 
zCOCO_test_helper.letter_boxc
Csp|jdd<01>}|d|d}|d|d}|jdkrT|j<02>t||||ddd<05><07>t<05>||d|df<02>}|S)Nrrr'Tr&)rr#r$r4rr/r0)r r5rr6rr rrrr<00> direct_resizeNs
zCOCO_test_helper.direct_resize<7A>xyxycCs<>t|<01>}|jdk<02>r<>|dk<02>r<>|dd<00>df|jdj8<|dd<00>df|jdj<t<05>|dd<00>dfd|jdjd<00>|dd<00>df<|dd<00>df|jdj8<|dd<00>df|jdj <t<05>|dd<00>dfd|jdjd<00>|dd<00>df<|dd<00>df|jdj8<|dd<00>df|jdj<t<05>|dd<00>dfd|jdjd<00>|dd<00>df<|dd<00>df|jdj8<|dd<00>df|jdj <t<05>|dd<00>dfd|jdjd<00>|dd<00>df<|S)NTr>rrr'r<00>)
rr#r$r
r<00>np<6E>cliprr r )r <00>box<6F> in_formatrrrr<00> get_real_boxWs  
  2  2  2  2zCOCO_test_helper.get_real_boxcCs$t|jdj<02>}t|jdj<03>}|jdj}|jdj}|dkrT|dkrT||krT|S|dkr<>|dkr<>|dd<00>dd<00>|| <00>f}n,|dkr<>|dkr<>|dd<00>|| <00>dd<00>f}t<06>|dd<02><03>tj <09><01>
ddd<02>}t j ||d|dft j d<05>}t|j<0F>dk<00>r|ddd<00>dd<00>fS|<01>
ddd<03>SdS)Nrrr'rr(r?)r,r$r r
rrr@<00>where<72>astype<70>uint8<74> transposer/r0r1<00>lenr)r <00>segr r
rrrrr<00> get_real_segms   zCOCO_test_helper.get_real_segc Cs<>|jdkr<>|dkr<>|d|jdj8<|d|jdj<|d|jdj8<|d|jdj<|d|jdj8<|d|jdj<|d|jdj8<|d|jdj<|dk<02>r|d|d|d<|d|d|d<nd<08>std <09><01>d
d <0B>}|dk<08>rN|j<07>||d d <0A>|D<00>t |d<0E>d<0F><04>n0||<06>}|j<07>||dd <0A>|D<00>t |d<0E>|d<11><05>dS)NTr>rrr'rr?FzFnow only support xyxy format, please add code to support others formatcSsLddlm}|tj|dd<00>dd<00>dfddd<05><03>d}|d<00>d<07>|d<|S)Nr)<01>encode<64>FrG)<02>order<65>dtype<70>countszutf-8)Zpycocotools.maskrLr@<00>asarray<61>decode)<03>xrLZrlerrr<00> single_encode<64>s *z9COCO_test_helper.add_single_record.<locals>.single_encodecSsg|]}t|d<00><02>qS<00>r?<00>r.<00><02>.0rSrrr<00>
<listcomp><3E>sz6COCO_test_helper.add_single_record.<locals>.<listcomp><3E>)<04>image_id<69> category_idr<00>scorecSsg|]}t|d<00><02>qSrUrVrWrrrrY<00>s)r[r\rr]<00> segmentation)
r#r$r
rr r <00>AssertionErrorr"r4r.) r r[r\rr]rCZ
pred_masksrTZrlesrrr<00>add_single_record<72>s8


 <08>
 <02>z"COCO_test_helper.add_single_recordc Cs(t|d<01><02>}t<01>|j|<02>W5QRXdS)N<>w)<04>open<65>json<6F>dumpr")r <00>path<74>frrr<00>export_to_json<6F>s zCOCO_test_helper.export_to_json)F)r&F)F)r>)r>N)
rrrrr<r=rDrKr`rgrrrrr!'s


-r!) r<00>osr/<00>numpyr@rcrr r!rrrr<00><module>s