roc2.1.3 2.1.3
just a simple test of vipkid
License: MIT
Keywords: simple,test

####

ÔËÐÐ°ì·¨£º
   
    »·¾³£ºpython2    
    ÔËÐÐÇ°ÏÈ°²×°ROC,transformºÍconRoc,°²×°°ì·¨£º
    pip install roc2.1.2


    roc:
        ÊäÈë£ºÎÄ¼þ¼Ðtruth£¨±ê×¢½á¹ûÎÄ¼þ¼Ð£©,test£¨Ä£ÐÍÊä³öµÄ½á¹ûÎÄ¼þ¼Ð£©,result(Òª±£´æµÄtxtÎÄ±¾ÎÄµµÂ·¾¶£©£¬roc(Òª±£´æµÄÍ¼Æ¬Â·¾¶£©
        python 
                from ROC import roc
                roc.roc("truth","test","result","roc")
        Êä³ö£ºrocºÍ·ÖÊýÕÛÏßÍ¼,½á¹ûµÄÎÄ±¾ÎÄµµ
        PS:result ºÍroc²»´ø¸ñÊ½£¨Àý£º'D:\\python_work\\result')


    drawpic:
        ÊäÈë£ºÎÄ¼þ¼Ðpre_file(ÐèÒª»æÍ¼µÄtxtËùÔÚµÄÎÄ¼þ¼Ð£©,image(Òª±£´æµÄÍ¼Æ¬Â·¾¶£©,titlestr(Í¼Æ¬±êÌâ£©
        python 
                from ROC import conRoc
                conRoc.conRoc("pre_file","image","titlestr")
        Êä³ö£ºrocÕÛÏßÍ¼
        PS:image²»´ø¸ñÊ½£¨Àý£º'D:\\python_work\\image') 
     
   
    txt2xml:
        ÊäÈë£ºtxt_file(txt¸ñÊ½±ê×¢ÐÅÏ¢Ëù´æ·ÅÎÄ¼þ¼Ð£©
        python
                from transform import txt2xml
                txt2xml.txt2xml("txt_file","xml_file")
        Êä³ö£ºxml_file(xml¸ñÊ½±ê×¢ÐÅÏ¢Ëù´æ·ÅÎÄ¼þ¼Ð£©  
 

    xml2txt:
        ÊäÈë£ºxml_file(xml¸ñÊ½±ê×¢ÐÅÏ¢Ëù´æ·ÅÎÄ¼þ¼Ð£©
        python
                from transform import xml2txt
                xml2txt.xml2txt("xml_file","txt_file")
        Êä³ö£ºtxt_file(txt¸ñÊ½±ê×¢ÐÅÏ¢Ëù´æ·ÅÎÄ¼þ¼Ð£©
  

    DataOfRoc:
        ÊäÈë£ºÎÄ¼þ¼Ðtruth£¨±ê×¢½á¹ûÎÄ¼þ¼Ð£©,test£¨Ä£ÐÍÊä³öµÄ½á¹ûÎÄ¼þ¼Ð£©
        python 
                from ROC import DataOfRoc
                DataOfRoc.DataOfRoc("truth","test")
        Êä³ö£ºtp£¨Îó¶Á¸öÊý£©,pos£¨Êµ¼ÊÕýÈ·¸öÊý£©,rate£¨ÕÙ»ØÂÊ£©
      

    IOU£º
        ÊäÈë£ºReframe,GTframe(Á½¸öÁÐ±í£¬ÄÚÈÝÎª¾ØÐÎµÄ¶¨µã×ø±êXmin,Ymin,Xmax,Ymax)
        python
                from ROC import IOU
                IOU.IOU(Reframe,GTframe)
        Êä³ö£ºratio(Á½³¤·½ÐÎÃæ»ýÖØµþ±ÈÂÊ£©
  

    scoreRoc£º
        ÊäÈë£ºlistdata(Êý¾ÝÁÐ±í:Ã¿×éÊý¾Ýwei:[ÊÇ·ñ´íÎó£¨1/0£©,ÊÇ·ñÕýÈ·£¨1/0£©,score]£©,result(Òª±£´æµÄtxtÎÄ±¾ÎÄµµÂ·¾¶£©£¬roc(Òª±£´æµÄÍ¼Æ¬Â·¾¶£©
        python 
                from ROC import scoreRoc
                scoreRoc.scoreRoc(listdata,"result","roc")
        Êä³ö£ºrocºÍ·ÖÊýÕÛÏßÍ¼,½á¹ûµÄÎÄ±¾ÎÄµµ
        PS:result ºÍroc²»´ø¸ñÊ½£¨Àý£º'D:\\python_work\\result')


    nms£º
        ÊäÈë£º
        python
                from nms import nms
                nms.nms()
        Êä³ö£º





ÎÄ¼þ¼ÐËµÃ÷£º

transformÎÄ¼þ¼Ð£º

txt2xml £º½«txt¸ñÊ½ÎÄ±¾×ª»»ÎªxmlÎÄ¼þ£¨Ã¿¸ötxtÎÄ¼þ×ª»»ÎªÒ»¸öxmlÎÄ¼þ£©
          ÐèÒª×ª»»µÄËùÓÐtxtÎÄ¼þ·ÅÔÚtxt_fileÖÐ£¬×ª»»ºóµÄxmlÎÄ¼þ´æ·ÅÔÚxml_fileÖÐ 

xml2txt £º½«xml¸ñÊ½ÎÄ±¾×ª»»ÎªtxtÎÄ¼þ£¨Ã¿¸öxmlÎÄ¼þ×ª»»ÎªÒ»¸ötxtÎÄ¼þ£©
          ÐèÒª×ª»»µÄËùÓÐxmlÎÄ¼þ·ÅÔÚxml_fileÖÐ£¬×ª»»ºóµÄtxtÎÄ¼þ´æ·ÅÔÚtxt_fileÖÐ                   

  
ROCÎÄ¼þ¼Ð£º

roc: »æÖÆrocÇúÏßºÍ·ÖÊýÇúÏß²¢¼ÆËãacu¡£Êý¾ÝÀ´Ô´ÓÚdbÁÐ±í

IOU: ¼ÆËãÁ½¾ØÐÎIOU,´«ÈëÊý¾ÝÎªÃ¿¸ö¾ØÐÎÁ½Ìõ¶Ô½ÇÏßµÄºá×Ý×ø±êReframe=[X1,Y1,X2,Y2],GTframe=[X1,Y1,X2,Y2]¡£

read:¶ÁÈ¡xmlÎÄ¼þµÄËùÓÐ±ê×¢µÄ±êÇ©Êý¾Ý(xmin,ymin,xmax,ymax)¡£´«ÈëÊý¾ÝÎª´ý²âÊÔxmlÎÄµµµÄÔªËØ¶ÔÏó¡£

Analyze£º½âÎöxmlÎÄ¼þ²¢µÃ³öIOU±È¶ÔÖÐ±È¶Ô´íÎó(ÖØµþ±ÈÂÊÐ¡ÓÚ0.5£©ºÍ±È¶ÔÕýÈ·µÄ¸öÊý¡£
         ÊäÈë£ºtruthÎª±ê×¼xmlÎÄ¼þËùÔÚµÄÎÄ¼þ¼Ð£¬testÎª´ý±È¶ÔµÄxmlÎÄ¼þËùÔÚµÄÎÄ¼þ¼Ð¡£

scoreRoc£º¸ù¾ÝÁÐ±íÊý¾Ý£¬»æÖÆrocÇúÏß
          ÁÐ±íÃ¿×éÊý¾ÝÎª[wrong,right,score] wrongÓërightÎªÎó¶ÁºÍÕýÈ·µÄ±êÊ¶£¬ÖµÎª1/0£¬scoreÀ´Ô´ÓÚxmlÎÄ¼þ

DataOfRoc:±È½ÏÁ½¸öÎÄ¼þ¼ÐÖÐµÄxmlÎÄ¼þ£¬²¢¼ÆËã³öÎó¶Á¸öÊý£¬Êµ¼ÊÕýÈ·¸öÊý£¬ºÍÕÙ»ØÂÊ

drawpic:¸ù¾ÝÁ½¸öÎÄ¼þ¼ÐÖÐtxtÎÄ¼þ»­rocÇúÏßÍ¼¡£Ã¿¸ötxtÎÄ¼þ¶ÔÓ¦ÑÕÉ«ÏàÍ¬µÄÁ½ÌõÇúÏß£¨ÕÙ»ØÂÊÇúÏßºÍ·ÖÊýÇúÏß£©


####