Module Import alias ImportFrom alias Import alias Import alias Import alias Import alias Import alias TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body ImportFrom alias Import alias Import alias Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Import alias Expr Call AttributeLoad AttributeLoad NameLoad attr attr ImportFrom alias Import alias Assign NameStore Call AttributeLoad NameLoad attr Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad keyword BinOpPow Num Num keyword NameLoad keyword NameLoad With Call AttributeLoad AttributeLoad NameLoad attr attr NameStore body Assign AttributeStore NameLoad attr SubscriptLoad Call AttributeLoad NameLoad attr Index Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str With Call AttributeLoad AttributeLoad NameLoad attr attr NameStore body Assign NameStore Call AttributeLoad NameLoad attr For NameStore NameLoad body Expr Yield NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad Str If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad Str Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad IfExp Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr BinOpMod Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr TryExcept body Assign NameStore Call NameLoad NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str AttributeLoad NameLoad attr Assign NameStore Call NameLoad Assign NameStore Num Assign NameStore NameLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad If BoolOpOr UnaryOpNot Call AttributeLoad NameLoad attr Str CompareEq AttributeLoad NameLoad attr Num UnaryOpNot Call AttributeLoad NameLoad attr Str CompareEq AttributeLoad NameLoad attr Num body If AttributeLoad NameLoad attr body If BoolOpOr NameLoad UnaryOpNot Call NameLoad Call AttributeLoad NameLoad attr body Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr orelse Assign NameStore Str Assign NameStore Str Assign NameStore Str orelse Assign NameStore Str Expr Call AttributeLoad NameLoad attr NameLoad Raise Call NameLoad NameLoad orelse Assign TupleStore NameStore NameStore NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad NameLoad AugAssignAdd SubscriptStore NameLoad Index NameLoad Num If BoolOpAnd NameLoad CompareGt Call NameLoad Call AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr BinOpMod Str Call NameLoad Call AttributeLoad NameLoad attr Return NameLoad AugAssignAdd NameStore Num If BoolOpOr CompareIs NameLoad NameLoad CompareGt BinOpSub Call AttributeLoad NameLoad attr NameLoad Num body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Expr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr If NameLoad body Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Assign SubscriptStore NameLoad Index SubscriptLoad Call AttributeLoad NameLoad attr Index Num NameLoad Break If CompareNotEq NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad AttributeLoad NameLoad attr NameLoad For TupleStore NameStore NameStore Call NameLoad Call AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr Num keyword NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad BinOpSub Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr If Call NameLoad SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str body Expr Call AttributeLoad NameLoad attr Num orelse Expr Call AttributeLoad NameLoad attr Num
N/A N/A argparse collections Counter N/A logging N/A operator N/A os.path N/A sys N/A time N/A N/A cStringIO StringIO N/A N/A N/A ImportError N/A StringIO StringIO N/A lmdb N/A PIL.Image N/A N/A N/A N/A sys path insert 0 N/A N/A N/A os path dirname N/A N/A N/A os path dirname N/A N/A N/A os path abspath __file__ N/A digits.config N/A N/A N/A N/A digits config load_config digits log N/A caffe_pb2 N/A logger N/A N/A logging getLogger digits.tools.analyze_db DbReader N/A object N/A N/A 
    Reads a database
     __init__ N/A N/A self location N/A N/A N/A 
        Arguments:
        location -- where is the database
         N/A N/A self _db N/A N/A lmdb open location map_size N/A 1024 3 readonly True lock False N/A N/A N/A N/A self _db begin txn N/A N/A N/A self total_entries N/A N/A N/A txn stat N/A entries N/A entries N/A N/A self N/A N/A N/A 
        Generator returning all entries in the DB
         N/A N/A N/A N/A self _db begin txn N/A N/A cursor N/A N/A txn cursor N/A item cursor N/A N/A N/A item N/A N/A validate_database_path N/A N/A database N/A N/A N/A 
    Returns a valid database path
    Throws ValueErrors
     N/A p N/A N/A N/A os path abspath database N/A N/A N/A N/A N/A os path exists p N/A N/A N/A ValueError No such file or directory N/A N/A N/A N/A os path isfile p N/A N/A p N/A N/A N/A os path dirname p N/A N/A N/A N/A N/A os path isdir p N/A N/A N/A ValueError Not a directory N/A p N/A print_datum N/A N/A datum N/A N/A N/A 
    Utility for printing a datum
     N/A N/A N/A logger debug N/A 	WxHxC:   %sx%sx%s N/A N/A datum width N/A datum height N/A datum channels N/A N/A N/A logger debug N/A 	Label:   %s N/A N/A N/A N/A datum HasField label N/A datum label None N/A N/A N/A logger debug N/A 	Encoded: %s N/A datum encoded N/A analyze_db N/A N/A database only_count force_same_shape N/A False False N/A N/A 
    Looks at the data in a prebuilt database and verifies it
        Also prints out some information about it
    Returns True if all entries are valid

    Arguments:
    database -- path to the database

    Keyword arguments:
    only_count -- only count the entries, don't inspect them
    force_same_shape -- throw an error if not all images have the same shape
     N/A start_time N/A N/A time time N/A N/A N/A database N/A validate_database_path database N/A N/A N/A ValueError N/A e N/A N/A N/A N/A logger error N/A e message N/A False N/A reader N/A DbReader database N/A N/A N/A logger info N/A Total entries: %s N/A reader total_entries N/A unique_shapes N/A Counter N/A count 0 N/A update_time None N/A N/A key value N/A N/A reader entries N/A N/A datum N/A N/A caffe_pb2 Datum N/A N/A N/A datum ParseFromString value N/A N/A N/A N/A N/A datum HasField height N/A N/A datum height 0 N/A N/A N/A datum HasField width N/A N/A datum width 0 N/A N/A N/A datum encoded N/A N/A N/A force_same_shape N/A N/A len N/A N/A unique_shapes keys N/A N/A s N/A StringIO N/A N/A N/A s write N/A datum data N/A N/A N/A s seek 0 N/A img N/A N/A N/A PIL Image open s N/A N/A width height N/A img size N/A channels N/A len N/A N/A img split N/A N/A width ? N/A height ? N/A channels ? N/A N/A errstr Shape is not set and datum is not encoded N/A N/A N/A logger error errstr N/A N/A ValueError errstr N/A N/A N/A width height channels N/A N/A datum width N/A datum height N/A datum channels N/A shape N/A %sx%sx%s N/A width height channels N/A N/A unique_shapes N/A shape 1 N/A N/A force_same_shape N/A N/A len N/A N/A unique_shapes keys 1 N/A N/A N/A N/A logger error N/A Images with different shapes found: %s and %s N/A tuple N/A N/A unique_shapes keys N/A False N/A count 1 N/A N/A N/A update_time None N/A N/A N/A N/A time time update_time 2 N/A N/A N/A N/A logger debug N/A >>> Key %s key N/A N/A print_datum datum N/A N/A N/A logger debug N/A Progress: %s/%s N/A count N/A reader total_entries N/A update_time N/A N/A time time N/A only_count N/A N/A count N/A reader total_entries N/A N/A N/A logger info Assuming all entries have same shape ... N/A N/A unique_shapes N/A N/A N/A N/A unique_shapes keys N/A 0 count N/A N/A N/A count N/A reader total_entries N/A N/A N/A N/A logger warning N/A LMDB reported %s total entries, but only read %s N/A N/A reader total_entries count N/A N/A key val N/A sorted N/A N/A unique_shapes items key N/A N/A operator itemgetter 1 reverse True N/A N/A N/A N/A logger info N/A %s entries found with shape %s (WxHxC) N/A val key N/A N/A N/A logger info N/A Completed in %s seconds. N/A N/A N/A N/A time time start_time N/A True N/A N/A N/A __name__ __main__ N/A N/A parser N/A N/A argparse ArgumentParser description Analyze-Db tool - DIGITS N/A N/A N/A parser add_argument database help Path to the database N/A N/A N/A parser add_argument --only-count action store_true help Only print the number of entries, don't analyze the data N/A N/A N/A parser add_argument --force-same-shape action store_true help Throw an error if not all entries have the same shape N/A args N/A vars N/A N/A parser parse_args N/A N/A analyze_db N/A args N/A database only_count N/A args N/A only_count force_same_shape N/A args N/A force_same_shape N/A N/A N/A N/A sys exit 0 N/A N/A N/A N/A sys exit 1