import numpy as np

# NOTE: these are the coco categories, including the following modifications to match with existing fasttext embeddings
# Fire hydrant - fireplug
# Street sign - signpost
# Parking meter - self-parking
# Sports-ball - ball
# Baseball-bat - mean(baseball, bat)
# Baseball-glove - mean(baseball, glove)
# Tennis-racket - mean(tennis, racket)
# Potted-plant - houseplant
# Hair-drier - hairdryer
# Hair-brush - hairbrush
# NOTE: to take embeddings, you need to make the following adjustments:
# Baseball-bat - mean(baseball, bat)
# Baseball-glove - mean(baseball, glove)
# Tennis-racket - mean(tennis, racket)
coco_categories_91 = [
    "person",
    "bicycle",
    "car",
    "motorcycle",
    "airplane",
    "bus",
    "train",
    "truck",
    "boat",
    "traffic-light",
    "fireplug",
    "signpost",
    "stop-sign",
    "self-parking",
    "bench",
    "bird",
    "cat",
    "dog",
    "horse",
    "sheep",
    "cow",
    "elephant",
    "bear",
    "zebra",
    "giraffe",
    "hat",
    "backpack",
    "umbrella",
    "shoe",
    "eye-glasses",
    "handbag",
    "tie",
    "suitcase",
    "frisbee",
    "skis",
    "snowboard",
    "ball",
    "kite",
    "baseball-bat",
    "baseball-glove",
    "skateboard",
    "surfboard",
    "tennis-racket",
    "bottle",
    "plate",
    "wine-glass",
    "cup",
    "fork",
    "knife",
    "spoon",
    "bowl",
    "banana",
    "apple",
    "sandwich",
    "orange",
    "broccoli",
    "carrot",
    "hot-dog",
    "pizza",
    "donut",
    "cake",
    "chair",
    "couch",
    "houseplant",
    "bed",
    "mirror",
    "dining-table",
    "window",
    "desk",
    "toilet",
    "door",
    "tv",
    "laptop",
    "mouse",
    "remote",
    "keyboard",
    "cell-phone",
    "microwave",
    "oven",
    "toaster",
    "sink",
    "refrigerator",
    "blender",
    "book",
    "clock",
    "vase",
    "scissors",
    "teddy-bear",
    "hairdryer",
    "toothbrush",
    "hairbrush",
]

# these are the coco categories, including the following modifications to match with existing fasttext embeddings
category_adjustments = {
    "Fire hydrant": "fireplug",
    "Street sign": "signpost",
    "Parking meter": "self-parking",
    "Sports-ball": "ball",
    "Baseball-bat": "mean(baseball, bat)",
    "Baseball-glove": "mean(baseball, glove)",
    "Tennis-racket": "mean(tennis, racket)",
    "Potted-plant": "houseplant",
    "Hair-drier": "hairdryer",
    "Hair-brush": "hairbrush",
}

# some spelling mistakes are made in the captions. Here, we fix them. Below is the list of all words counted as
# verbs by the nltk toolbox, but for which no embeddings exist. We fix some, and mark which others are truly
# missing vs. just a load of gibbereish.
verb_adjustments = {
    "unpealed": "_____no_embedding_____",
    "pirched": "_____no_embedding_____",
    "kitboarding": "kite-surfing",
    "suckingling": "sucking",
    "reahced": "reached",
    "ealking": "leaking",
    "bursking": "_____no_embedding_____",
    "d'oeuvre": "_____not_verb_/_unknown_____",
    "PIcked": "picked",
    "wlaks": "walks",
    "Parketing": "_____not_verb_/_unknown_____",
    "plowig": "plowing",
    "igrinding": "grinding",
    "hay.surrounded": "surrounded",
    "depics": "depicts",
    "oarked": "parked",
    "toothpicked": "_____no_embedding_____",
    "staanding": "standing",
    "Delapidated": "dilapidated",
    "foilaged": "foliaged",
    "parasurfing": "_____no_embedding_____",
    "giraffestanding": "standing",
    "deckered": "_____no_embedding_____",
    "expolsed": "_____not_verb_/_unknown_____",
    "attachced": "attached",
    "holdong": "holding",
    "Horsed": "_____not_verb_/_unknown_____",
    "dessed": "dressed",
    "hook'n": "_____not_verb_/_unknown_____",
    "traveleing": "travelling",
    "rididing": "riding",
    "caryring": "carrying",
    "rcieve": "receive",
    "fluies": "_____not_verb_/_unknown_____",
    "grabbbing": "grabbing",
    "ptiched": "pitched",
    "skatboarding": "skateboarding",
    "cat6ching": "catching",
    "hurts.with": "hurts",
    "para-skiing": "_____no_embedding_____",
    "wnjoying": "enjoying",
    "ttied": "_____not_verb_/_unknown_____",
    "GRazing": "grazing",
    "rollled": "rolled",
    "standinf": "standing",
    "staniding": "standing",
    "layling": "laying",
    "ollying": "_____no_embedding_____",
    "siitting": "sitting",
    "carrots.with": "_____not_verb_/_unknown_____",
    "trhowing": "throwing",
    "sittign": "sitting",
    "stnading": "standing",
    "kites.are": "are",
    "halds": "_____not_verb_/_unknown_____",
    "lpulls": "pulls",
    "voered": "_____not_verb_/_unknown_____",
    "sitares": "_____not_verb_/_unknown_____",
    "grasing": "grazing",
    "unbarring": "_____no_embedding_____",
    "lfying": "flying",
    "ntear": "_____not_verb_/_unknown_____",
    "swiiming": "swimming",
    "stove.and": "_____not_verb_/_unknown_____",
    "stractighing": "_____not_verb_/_unknown_____",
    "and=f": "_____not_verb_/_unknown_____",
    "his/her": "_____not_verb_/_unknown_____",
    "grazzing": "grazing",
    "surfboarded": "_____no_embedding_____",
    "clollecting": "collecting",
    "tosaing": "_____not_verb_/_unknown_____",
    "covred": "covered",
    "Para-skiing": "_____no_embedding_____",
    "srawn": "_____not_verb_/_unknown_____",
    "walkint": "walking",
    "frisbe": "_____not_verb_/_unknown_____",
    "grazen": "_____not_verb_/_unknown_____",
    "flyiing": "flying",
    "abanadoned": "abandoned",
    "some3thing": "_____not_verb_/_unknown_____",
    "broccoloi": "_____not_verb_/_unknown_____",
    "carveing": "carving",
    "hillsided": "_____not_verb_/_unknown_____",
    "light/off": "_____not_verb_/_unknown_____",
    "para-surfing": "_____no_embedding_____",
    "advist": "_____not_verb_/_unknown_____",
    "whiipped": "whipped",
    "avobe": "_____not_verb_/_unknown_____",
    "surborading": "surfboarding",
    "graffited": "graffitied",
    "privliedged": "privileged",
    "watersking": "water-skiing",
    "sliceing": "slicing",
    "tusted": "_____not_verb_/_unknown_____",
    "skatebosrding": "skateboarding",
    "sprinlkling": "sprinkling",
    "ocvered": "covered",
    "studdying": "studying",
    "grafifti": "_____not_verb_/_unknown_____",
    "flyimg": "flying",
    "counter/sink": "_____not_verb_/_unknown_____",
    "besdie": "_____not_verb_/_unknown_____",
    "sihouetted": "silhouetted",
    "skattered": "scattered",
    "alining": "aligning",
    "deocrated": "decorated",
    "coraling": "corralling",
    "l9e": "_____not_verb_/_unknown_____",
    "paraglides": "_____no_embedding_____",
    "floweing": "flowing",
    "sillouetted": "silhouetted",
    "congaing": "_____not_verb_/_unknown_____",
    "PROTRUDING": "protruding",
    "tha'ts": "_____not_verb_/_unknown_____",
    "flowersetting": "setting",
    "boywearing": "wearing",
    "'stop": "_____not_verb_/_unknown_____",
    "clolthing": "_____not_verb_/_unknown_____",
    "mesmirizing": "mesmerizing",
    "kitchen/dining/living": "_____not_verb_/_unknown_____",
    "brushel": "_____not_verb_/_unknown_____",
    "convesate": "_____not_verb_/_unknown_____",
    "towling": "_____not_verb_/_unknown_____",
    "sittins": "sitting",
    "refuled": "_____no_embedding_____",
    "toucing": "touching",
    "Unsliced": "_____no_embedding_____",
    "readsd": "reads",
    "skiislaying": "_____not_verb_/_unknown_____",
    "slying": "lying",
    "walking.with": "walking",
    "standng": "standing",
    "fieled": "_____not_verb_/_unknown_____",
    "caryiing": "carrying",
    "Longhorned": "_____not_verb_/_unknown_____",
    "cloesd": "closed",
    "hancrafted": "handcrafted",
    "icolored": "colored",
    "top'ed": "_____not_verb_/_unknown_____",
    "aparking": "parking",
    "dirnking": "drinking",
    "lookkng": "looking",
    "prpeared": "prepared",
    "layning": "laying",
    "desceibes": "describes",
    "slideing": "sliding",
    "likek": "_____not_verb_/_unknown_____",
    "stratches": "_____not_verb_/_unknown_____",
    "ridinh": "riding",
    "ahopping": "hopping",
    "snowbording": "snowboarding",
    "panaled": "_____not_verb_/_unknown_____",
    "mustard.sitting": "sitting",
    "walkling": "walking",
    "stnding": "standing",
    "patked": "_____not_verb_/_unknown_____",
    "Dued": "_____not_verb_/_unknown_____",
    "rebutton": "_____not_verb_/_unknown_____",
    "lounding": "_____not_verb_/_unknown_____",
    "countring": "_____not_verb_/_unknown_____",
    "chearleading": "cheerleading",
    "parlked": "parked",
    "Basketed": "_____no_embedding_____",
    "tablecothed": "_____not_verb_/_unknown_____",
    "atteached": "attached",
    "him/her": "_____not_verb_/_unknown_____",
    "higging": "hugging",
    "i=on": "_____not_verb_/_unknown_____",
    "pplaying": "playing",
    "knelled": "_____not_verb_/_unknown_____",
    "kermet": "_____not_verb_/_unknown_____",
    "controllers.in": "_____not_verb_/_unknown_____",
    "ball.during": "_____not_verb_/_unknown_____",
    "stadning": "standing",
    "walkiing": "walking",
    "eaating": "eating",
    "exetended": "extended",
    "nibiling": "nibbling",
    "bedhing": "_____not_verb_/_unknown_____",
    "cheffin": "_____not_verb_/_unknown_____",
    "ridi9ng": "riding",
    "COLLIDING": "colliding",
    "skinig": "skiing",
    "ridinbg": "riding",
    "Spauliding": "_____not_verb_/_unknown_____",
    "skaking": "skating",
    "biched": "_____not_verb_/_unknown_____",
    "TVsitting": "sitting",
    "siking": "skiing",
    "youing": "_____not_verb_/_unknown_____",
    "pitchforking": "_____no_embedding_____",
    "reachiing": "reaching",
    "umberellas": "_____not_verb_/_unknown_____",
    "invesigating": "investigating",
    "vegetables.covered": "covered",
    "rtbF": "_____not_verb_/_unknown_____",
    "swigning": "swinging",
    "fasioned": "_____not_verb_/_unknown_____",
    "half-covering": "covering",
    "ecorated": "_____not_verb_/_unknown_____",
    "dipicting": "depicting",
    "silhoetted": "silhouetted",
    "stoppedon": "stopped",
    "hsome": "_____not_verb_/_unknown_____",
    "deocarated": "decorated",
    "elephant.at": "_____not_verb_/_unknown_____",
    "paraskiing": "_____no_embedding_____",
    "placining": "placing",
    "shrubbs": "_____not_verb_/_unknown_____",
    "standihng": "standing",
    "irding": "riding",
    "srufing": "surfing",
    "resembing": "resembling",
    "Aproned": "_____not_verb_/_unknown_____",
    "waterskiis": "_____no_embedding_____",
    "lfits": "lifts",
    "sittinng": "sitting",
    "t=with": "_____not_verb_/_unknown_____",
    "croched": "_____not_verb_/_unknown_____",
    "standig": "_____not_verb_/_unknown_____",
    "fly-hing": "flying",
    "ehating": "heating",
    "metling": "melting",
    "signs.On": "_____not_verb_/_unknown_____",
    "stetched": "_____not_verb_/_unknown_____",
    "cocered": "_____not_verb_/_unknown_____",
    "doecarted": "decorated",
    "leanding": "_____not_verb_/_unknown_____",
    "stanging": "standing",
    "buriesd": "buried",
    "payign": "paying",
    "widnshield": "_____not_verb_/_unknown_____",
}


# some spelling mistakes are made in the captions. Here, we fix them. Below is the list of all words counted as
# verbs by the nltk toolbox, but for which no embeddings exist. We fix some, and mark which others are truly
# missing vs. just a load of gibbereish.
noun_adjustments = {}
