Esempio n. 1
0
def next_image(event):
    global imgcnt
    global imageList
    global evaluator
    global cat_filter
    old_cat=tdb.defineCategory(tdb.get(imageList[imgcnt]))
    print("old category: "+old_cat)
    tdb.updateRecord(evaluator.write_record(),imageList[imgcnt])
    tdb.addDefaultPath(imageList[imgcnt])
    new_cat=tdb.defineCategory(tdb.get(imageList[imgcnt]))
    print("new category: "+new_cat)
    if (old_cat!=new_cat):
        tdb.deleteCatRecord(tdb.get(imageList[imgcnt]), old_cat)
        tdb.addCatRecord(tdb.get(imageList[imgcnt]), new_cat)
        imageList = np.asarray(tdb.getImageList(cat_filter))
        
    else:
        tdb.addCatRecord(tdb.get(imageList[imgcnt]), new_cat)
    tdb.organize(tdb.get(imageList[imgcnt]))
    #tdb.addDefaultPath(imageList[imgcnt])
    #tdb.organize(imageList[imgcnt])
    
    tdb.updateInitPath()
    if imgcnt < len(imageList)-1:
        
        imgcnt += 1
        tx_attributes=tdb.get(imageList[imgcnt])
        evaluator.update_frames(imageList[imgcnt], tx_attributes)
    tdb.save(imageList[imgcnt], cat_filter)
    #print("#"+str(imgcnt)+": "+imageList[imgcnt])
    print("\n")
Esempio n. 2
0
import os
import glob
import initialize_database as tdb
import numpy as np

imageList = np.asarray(tdb.getImageList())
imgcnt = 0
while imgcnt <= 5120:
    tdb.organize(imageList[imgcnt])
    imgcnt += 1