def image_test_new(m):
    try:
        example_image = '/Users/royyang/Desktop/ehow_image/'+str(m)+'.jpg'
        input_image = caffe.io.load_image(example_image)
        leafNode_result, bet_result = net.classify_image(input_image)
        return (str(m)+'\t'+url[m]+'\t'+str(bet_result)+'\t'+str(leafNode_result)+'\t'+str(caption[m])+'\n')
    except Exception as err:
        return m
예제 #2
0
def image_test_new(m):
    try:
        example_image = '/Users/royyang/Desktop/ehow_image/' + str(m) + '.jpg'
        input_image = caffe.io.load_image(example_image)
        leafNode_result, bet_result = net.classify_image(input_image)
        return (str(m) + '\t' + url[m] + '\t' + str(bet_result) + '\t' +
                str(leafNode_result) + '\t' + str(caption[m]) + '\n')
    except Exception as err:
        return m
def image_test((m,n)):
    print m,n
    new.write('\n')
    for i in range(m,n):
        try:
            example_image = '/Users/royyang/Desktop/ehow_image/'+str(i)+'.jpg'
            input_image = caffe.io.load_image(example_image)
            leafNode_result, bet_result = net.classify_image(input_image)
            new.write(str(i)+'\t'+url[i]+'\t'+str(bet_result)+'\t'+str(leafNode_result)+'\n')
        except Exception as err:
            print i
예제 #4
0
def image_test((m, n)):
    print m, n
    new.write('\n')
    for i in range(m, n):
        try:
            example_image = '/Users/royyang/Desktop/ehow_image/' + str(
                i) + '.jpg'
            input_image = caffe.io.load_image(example_image)
            leafNode_result, bet_result = net.classify_image(input_image)
            new.write(
                str(i) + '\t' + url[i] + '\t' + str(bet_result) + '\t' +
                str(leafNode_result) + '\n')
        except Exception as err:
            print i