steps = 8
n_runs = 1
img_path = 'datasets/ImageNet/images/'
data_root = 'exp/linear_probe/ImageNet'
img_split_path = 'datasets/ImageNet/splits'

num_cls = 1000
unfreeze_clip = False
paper = True

clip_model='ViT-B/32' #['RN50', 'RN101', 'RN50x4', 'RN50x16', 'RN50x64', 'ViT-B/32', 'ViT-B/16', 'ViT-L/14', 'ViT-L/14@336px']

lr=1e-3
bs=128
n_shots = 8
dataset = 'imagenet'

img_ext = ''
cls_names = [
    'tench', 'brambling', 'house finch', 'indigo bunting', 'goldfish',
    'great white shark', 'tiger shark', 'hammerhead shark', 'electric ray',
    'stingray', 'cock', 'hen', 'ostrich', 'goldfinch', 'junco', 'robin',
    'bulbul', 'jay', 'magpie', 'chickadee', 'water ouzel', 'kite(bird)',
    'bald eagle', 'vulture', 'great grey owl', 'european fire salamander',
    'common newt', 'eft', 'spotted salamander', 'axolotl', 'bullfrog',
    'tree frog', 'tailed frog', 'loggerhead turtle', 'leatherback turtle',
    'mud turtle', 'terrapin', 'box turtle', 'banded gecko', 'common iguana',
    'american chameleon', 'whiptail lizard', 'agama', 'frilled lizard',
    'alligator lizard', 'gila monster', 'green lizard', 'african chameleon',
    'komodo dragon', 'african crocodile', 'american alligator', 'triceratops',
    'thunder snake', 'ringneck snake', 'hognose snake', 'green snake',
    'king snake', 'garter snake', 'water snake', 'vine snake', 'night snake',
    'boa constrictor', 'rock python', 'indian cobra', 'green mamba',
    'sea snake', 'horned viper', 'diamondback', 'sidewinder', 'trilobite',
    'harvestman', 'scorpion', 'black and gold garden spider', 'barn spider',
    'garden spider', 'black widow', 'tarantula', 'wolf spider', 'tick',
    'centipede', 'black grouse', 'ptarmigan', 'ruffed grouse',
    'prairie chicken', 'peacock', 'quail', 'partridge', 'african grey',
    'macaw', 'sulphur-crested cockatoo', 'lorikeet', 'coucal', 'bee eater',
    'hornbill', 'hummingbird', 'jacamar', 'toucan', 'drake',
    'red-breasted merganser', 'goose', 'black swan', 'tusker', 'echidna',
    'platypus', 'wallaby', 'koala', 'wombat', 'jellyfish', 'sea anemone',
    'brain coral', 'flatworm', 'nematode', 'conch', 'snail', 'slug',
    'sea slug', 'chiton', 'chambered nautilus', 'dungeness crab', 'rock crab',
    'fiddler crab', 'king crab', 'american lobster', 'spiny lobster',
    'crayfish', 'hermit crab', 'isopod', 'white stork', 'black stork',
    'spoonbill', 'flamingo', 'little blue heron', 'american egret', 'bittern',
    'crane(bird)', 'limpkin', 'european gallinule', 'american coot', 'bustard',
    'ruddy turnstone', 'red-backed sandpiper', 'redshank', 'dowitcher',
    'oystercatcher', 'pelican', 'king penguin', 'albatross', 'grey whale',
    'killer whale', 'dugong', 'sea lion', 'chihuahua', 'japanese spaniel',
    'maltese dog', 'pekinese', 'shih-tzu', 'blenheim spaniel', 'papillon',
    'toy terrier', 'rhodesian ridgeback', 'afghan hound', 'basset', 'beagle',
    'bloodhound', 'bluetick', 'black-and-tan coonhound', 'walker hound',
    'english foxhound', 'redbone', 'borzoi', 'irish wolfhound',
    'italian greyhound', 'whippet', 'ibizan hound', 'norwegian elkhound',
    'otterhound', 'saluki', 'scottish deerhound', 'weimaraner',
    'staffordshire bullterrier', 'american staffordshire terrier',
    'bedlington terrier', 'border terrier', 'kerry blue terrier',
    'irish terrier', 'norfolk terrier', 'norwich terrier', 'yorkshire terrier',
    'wire-haired fox terrier', 'lakeland terrier', 'sealyham terrier',
    'airedale', 'cairn', 'australian terrier', 'dandie dinmont', 'boston bull',
    'miniature schnauzer', 'giant schnauzer', 'standard schnauzer',
    'scotch terrier', 'tibetan terrier', 'silky terrier',
    'soft-coated wheaten terrier', 'west highland white terrier', 'lhasa',
    'flat-coated retriever', 'curly-coated retriever', 'golden retriever',
    'labrador retriever', 'chesapeake bay retriever',
    'german short-haired pointer', 'vizsla', 'english setter', 'irish setter',
    'gordon setter', 'brittany spaniel', 'clumber', 'english springer',
    'welsh springer spaniel', 'cocker spaniel', 'sussex spaniel',
    'irish water spaniel', 'kuvasz', 'schipperke', 'groenendael', 'malinois',
    'briard', 'kelpie', 'komondor', 'old english sheepdog',
    'shetland sheepdog', 'collie', 'border collie', 'bouvier des flandres',
    'rottweiler', 'german shepherd', 'doberman', 'miniature pinscher',
    'greater swiss mountain dog', 'bernese mountain dog', 'appenzeller',
    'entlebucher', 'boxer', 'bull mastiff', 'tibetan mastiff',
    'french bulldog', 'great dane', 'saint bernard', 'eskimo dog', 'malamute',
    'siberian husky', 'dalmatian', 'affenpinscher', 'basenji', 'pug',
    'leonberg', 'newfoundland', 'great pyrenees', 'samoyed', 'pomeranian',
    'chow', 'keeshond', 'brabancon griffon', 'pembroke',
    'cardigan welsh corgi', 'toy poodle', 'miniature poodle',
    'standard poodle', 'mexican hairless', 'timber wolf', 'white wolf',
    'red wolf', 'coyote', 'dingo', 'dhole', 'african hunting dog', 'hyena',
    'red fox', 'kit fox', 'arctic fox', 'grey fox', 'tabby', 'tiger cat',
    'persian cat', 'siamese cat', 'egyptian cat', 'cougar', 'lynx', 'leopard',
    'snow leopard', 'jaguar', 'lion', 'tiger', 'cheetah', 'brown bear',
    'american black bear', 'ice bear', 'sloth bear', 'mongoose', 'meerkat',
    'tiger beetle', 'ladybug', 'ground beetle', 'long-horned beetle',
    'leaf beetle', 'dung beetle', 'rhinoceros beetle', 'weevil', 'fly', 'bee',
    'ant', 'grasshopper', 'cricket', 'walking stick', 'cockroach', 'mantis',
    'cicada', 'leafhopper', 'lacewing', 'dragonfly', 'damselfly', 'admiral',
    'ringlet', 'monarch', 'cabbage butterfly', 'sulphur butterfly', 'lycaenid',
    'starfish', 'sea urchin', 'sea cucumber', 'wood rabbit', 'hare', 'angora',
    'hamster', 'porcupine', 'fox squirrel', 'marmot', 'beaver', 'guinea pig',
    'sorrel', 'zebra', 'hog', 'wild boar', 'warthog', 'hippopotamus', 'ox',
    'water buffalo', 'bison', 'ram', 'bighorn', 'ibex', 'hartebeest', 'impala',
    'gazelle', 'arabian camel', 'llama', 'weasel', 'mink', 'polecat',
    'black-footed ferret', 'otter', 'skunk', 'badger', 'armadillo',
    'three-toed sloth', 'orangutan', 'gorilla', 'chimpanzee', 'gibbon',
    'siamang', 'guenon', 'patas', 'baboon', 'macaque', 'langur', 'colobus',
    'proboscis monkey', 'marmoset', 'capuchin', 'howler monkey', 'titi',
    'spider monkey', 'squirrel monkey', 'madagascar cat', 'indri',
    'indian elephant', 'african elephant', 'red panda', 'giant panda',
    'barracouta', 'eel', 'coho', 'rock beauty', 'anemone fish', 'sturgeon',
    'gar', 'lionfish', 'puffer', 'abacus', 'abaya', 'academic gown',
    'accordion', 'acoustic guitar', 'aircraft carrier', 'airliner', 'airship',
    'altar', 'ambulance', 'amphibian', 'analog clock', 'apiary', 'apron',
    'ashcan', 'assault rifle', 'backpack', 'bakery', 'balance beam', 'balloon',
    'ballpoint', 'band aid', 'banjo', 'bannister', 'barbell', 'barber chair',
    'barbershop', 'barn', 'barometer', 'barrel', 'barrow', 'baseball',
    'basketball', 'bassinet', 'bassoon', 'bathing cap', 'bath towel',
    'bathtub', 'beach wagon', 'beacon', 'beaker', 'bearskin', 'beer bottle',
    'beer glass', 'bell cote', 'bib', 'bicycle-built-for-two', 'bikini',
    'binder', 'binoculars', 'birdhouse', 'boathouse', 'bobsled', 'bolo tie',
    'bonnet', 'bookcase', 'bookshop', 'bottlecap', 'bow', 'bow tie', 'brass',
    'brassiere', 'breakwater', 'breastplate', 'broom', 'bucket', 'buckle',
    'bulletproof vest', 'bullet train', 'butcher shop', 'cab', 'caldron',
    'candle', 'cannon', 'canoe', 'can opener', 'cardigan(cloth)', 'car mirror',
    'carousel', "carpenter's kit", 'carton', 'car wheel', 'cash machine',
    'cassette', 'cassette player', 'castle', 'catamaran', 'cd player', 'cello',
    'cellular telephone', 'chain', 'chainlink fence', 'chain mail',
    'chain saw', 'chest', 'chiffonier', 'chime', 'china cabinet',
    'christmas stocking', 'church', 'cinema', 'cleaver', 'cliff dwelling',
    'cloak', 'clog', 'cocktail shaker', 'coffee mug', 'coffeepot', 'coil',
    'combination lock', 'computer keyboard', 'confectionery', 'container ship',
    'convertible', 'corkscrew', 'cornet', 'cowboy boot', 'cowboy hat',
    'cradle', 'crane(machine)', 'crash helmet', 'crate', 'crib', 'crock pot',
    'croquet ball', 'crutch', 'cuirass', 'dam', 'desk', 'desktop computer',
    'dial telephone', 'diaper', 'digital clock', 'digital watch',
    'dining table', 'dishrag', 'dishwasher', 'disk brake', 'dock', 'dogsled',
    'dome', 'doormat', 'drilling platform', 'drum', 'drumstick', 'dumbbell',
    'dutch oven', 'electric fan', 'electric guitar', 'electric locomotive',
    'entertainment center', 'envelope', 'espresso maker', 'face powder',
    'feather boa', 'file', 'fireboat', 'fire engine', 'fire screen',
    'flagpole', 'flute', 'folding chair', 'football helmet', 'forklift',
    'fountain', 'fountain pen', 'four-poster', 'freight car', 'french horn',
    'frying pan', 'fur coat', 'garbage truck', 'gasmask', 'gas pump', 'goblet',
    'go-kart', 'golf ball', 'golfcart', 'gondola', 'gong', 'gown',
    'grand piano', 'greenhouse', 'grille', 'grocery store', 'guillotine',
    'hair slide', 'hair spray', 'half track', 'hammer', 'hamper',
    'hand blower', 'hand-held computer', 'handkerchief', 'hard disc',
    'harmonica', 'harp', 'harvester', 'hatchet', 'holster', 'home theater',
    'honeycomb', 'hook', 'hoopskirt', 'horizontal bar', 'horse cart',
    'hourglass', 'ipod', 'iron', "jack-o'-lantern", 'jean', 'jeep', 'jersey',
    'jigsaw puzzle', 'jinrikisha', 'joystick', 'kimono', 'knee pad', 'knot',
    'lab coat', 'ladle', 'lampshade', 'laptop', 'lawn mower', 'lens cap',
    'letter opener', 'library', 'lifeboat', 'lighter', 'limousine', 'liner',
    'lipstick', 'loafer', 'lotion', 'loudspeaker', 'loupe', 'lumbermill',
    'magnetic compass', 'mailbag', 'mailbox', 'maillot(tights for dancers)',
    'maillot(tank suit)', 'manhole cover', 'maraca', 'marimba', 'mask',
    'matchstick', 'maypole', 'maze', 'measuring cup', 'medicine chest',
    'megalith', 'microphone', 'microwave', 'military uniform', 'milk can',
    'minibus', 'miniskirt', 'minivan', 'missile', 'mitten', 'mixing bowl',
    'mobile home', 'model t', 'modem', 'monastery', 'monitor', 'moped',
    'mortar', 'mortarboard', 'mosque', 'mosquito net', 'motor scooter',
    'mountain bike', 'mountain tent', 'mouse', 'mousetrap', 'moving van',
    'muzzle', 'nail', 'neck brace', 'necklace', 'nipple(feeding bottle)',
    'notebook', 'obelisk', 'oboe', 'ocarina', 'odometer', 'oil filter',
    'organ', 'oscilloscope', 'overskirt', 'oxcart', 'oxygen mask', 'packet',
    'paddle', 'paddlewheel', 'padlock', 'paintbrush', 'pajama', 'palace',
    'panpipe', 'paper towel', 'parachute', 'parallel bars', 'park bench',
    'parking meter', 'passenger car', 'patio', 'pay-phone', 'pedestal',
    'pencil box', 'pencil sharpener', 'perfume', 'petri dish', 'photocopier',
    'pick', 'pickelhaube', 'picket fence', 'pickup', 'pier', 'piggy bank',
    'pill bottle', 'pillow', 'ping-pong ball', 'pinwheel', 'pirate', 'pitcher',
    'plane', 'planetarium', 'plastic bag', 'plate rack', 'plow', 'plunger',
    'polaroid camera', 'pole', 'police van', 'poncho', 'pool table',
    'pop bottle', 'pot', "potter's wheel", 'power drill', 'prayer rug',
    'printer', 'prison', 'projectile', 'projector', 'puck', 'punching bag',
    'purse', 'quill', 'quilt', 'racer', 'racket', 'radiator', 'radio',
    'radio telescope', 'rain barrel', 'recreational vehicle', 'reel',
    'reflex camera', 'refrigerator', 'remote control', 'restaurant',
    'revolver', 'rifle', 'rocking chair', 'rotisserie', 'rubber eraser',
    'rugby ball', 'rule', 'running shoe', 'safe', 'safety pin', 'saltshaker',
    'sandal', 'sarong', 'sax', 'scabbard', 'scale', 'school bus', 'schooner',
    'scoreboard', 'screen', 'screw', 'screwdriver', 'seat belt',
    'sewing machine', 'shield', 'shoe shop', 'shoji', 'shopping basket',
    'shopping cart', 'shovel', 'shower cap', 'shower curtain', 'ski',
    'ski mask', 'sleeping bag', 'slide rule', 'sliding door', 'slot',
    'snorkel', 'snowmobile', 'snowplow', 'soap dispenser', 'soccer ball',
    'sock', 'solar dish', 'sombrero', 'soup bowl', 'space bar', 'space heater',
    'space shuttle', 'spatula', 'speedboat', 'spider web', 'spindle',
    'sports car', 'spotlight', 'stage', 'steam locomotive',
    'steel arch bridge', 'steel drum', 'stethoscope', 'stole', 'stone wall',
    'stopwatch', 'stove', 'strainer', 'streetcar', 'stretcher', 'studio couch',
    'stupa', 'submarine', 'suit', 'sundial', 'sunglass', 'sunglasses',
    'sunscreen', 'suspension bridge', 'swab', 'sweatshirt', 'swimming trunks',
    'swing', 'switch', 'syringe', 'table lamp', 'tank', 'tape player',
    'teapot', 'teddy', 'television', 'tennis ball', 'thatch',
    'theater curtain', 'thimble', 'thresher', 'throne', 'tile roof', 'toaster',
    'tobacco shop', 'toilet seat', 'torch', 'totem pole', 'tow truck',
    'toyshop', 'tractor', 'trailer truck', 'tray', 'trench coat', 'tricycle',
    'trimaran', 'tripod', 'triumphal arch', 'trolleybus', 'trombone', 'tub',
    'turnstile', 'typewriter keyboard', 'umbrella', 'unicycle', 'upright',
    'vacuum', 'vase', 'vault', 'velvet', 'vending machine', 'vestment',
    'viaduct', 'violin', 'volleyball', 'waffle iron', 'wall clock', 'wallet',
    'wardrobe', 'warplane', 'washbasin', 'washer', 'water bottle', 'water jug',
    'water tower', 'whiskey jug', 'whistle', 'wig', 'window screen',
    'window shade', 'windsor tie', 'wine bottle', 'wing', 'wok',
    'wooden spoon', 'wool', 'worm fence', 'wreck', 'yawl', 'yurt', 'web site',
    'comic book', 'crossword puzzle', 'street sign', 'traffic light',
    'book jacket', 'menu', 'plate', 'guacamole', 'consomme', 'hot pot',
    'trifle', 'ice cream', 'ice lolly', 'french loaf', 'bagel', 'pretzel',
    'cheeseburger', 'hotdog', 'mashed potato', 'head cabbage', 'broccoli',
    'cauliflower', 'zucchini', 'spaghetti squash', 'acorn squash',
    'butternut squash', 'cucumber', 'artichoke', 'bell pepper', 'cardoon',
    'mushroom', 'granny smith', 'strawberry', 'orange', 'lemon', 'fig',
    'pineapple', 'banana', 'jackfruit', 'custard apple', 'pomegranate', 'hay',
    'carbonara', 'chocolate sauce', 'dough', 'meat loaf', 'pizza', 'potpie',
    'burrito', 'red wine', 'espresso', 'cup', 'eggnog', 'alp', 'bubble',
    'cliff', 'coral reef', 'geyser', 'lakeside', 'promontory', 'sandbar',
    'seashore', 'valley', 'volcano', 'ballplayer', 'groom', 'scuba diver',
    'rapeseed', 'daisy', "yellow lady's slipper", 'corn', 'acorn', 'hip',
    'buckeye', 'coral fungus', 'agaric', 'gyromitra', 'stinkhorn', 'earthstar',
    'hen-of-the-woods', 'bolete', 'ear', 'toilet tissue'
]
