pylab.figure() pylab.ioff() pylab.clf() pylab.axis("off") pylab.title(title) pylab.imshow(img,interpolation="nearest",animated=True) modelname="./data/INRIA/inria_bothfull";it=7 import sys if len(sys.argv)>1: imname=sys.argv[1] else: imname="test1.png" #load the model m=util2.load("%s%d.model"%(modelname,it)) import pylab #show the model if True: print "Show model" pylab.figure(100) pylab.clf() util2.drawModel(m["ww"]) pylab.draw() print "---- Image %s----"%imname print img=util2.myimread(imname) #compute the HOG pyramid
#compute the hog pyramid f=pyrHOG2.pyrHOG(img,interv=10,savedir="",notsave=True,notload=True,hallucinate=cfg.hallucinate,cformat=True) #show the image fig=pylab.figure(20) pylab.ioff() axes=pylab.Axes(fig, [.0,.0,1.0,1.0]) fig.add_axes(axes) pylab.imshow(img,interpolation="nearest",animated=True) t=time.time() #for each class for ccls in cls: print print "Class: %s"%ccls #load the class model m=util2.load("%s%d.model"%(cfg.testname%ccls,7)) res=[] t1=time.time() #for each aspect for clm,m in enumerate(m): #scan the image with left and right models res.append(pyrHOG2RL.detectflip(f,m,None,hallucinate=cfg.hallucinate,initr=cfg.initr,ratio=cfg.ratio,deform=cfg.deform,bottomup=cfg.bottomup,usemrf=cfg.usemrf,small=False,cl=clm)) fuse=[] numhog=0 #fuse the detections for mix in res: tr=mix[0] fuse+=mix[1] numhog+=mix[3] rfuse=tr.rank(fuse,maxnum=300) nfuse=tr.cluster(rfuse,ovr=0.3,inclusion=False)