Spaces:
Build error
Build error
| from fastapi import FastAPI, File, UploadFile, Form | |
| from fastapi.responses import HTMLResponse | |
| from fastapi.staticfiles import StaticFiles | |
| from fastapi.templating import Jinja2Templates | |
| from PIL import Image | |
| import shutil | |
| import os | |
| from moviepy.editor import VideoFileClip | |
| from fastapi.responses import FileResponse | |
| import random | |
| import ultralytics | |
| from ultralytics import RTDETR | |
| import cv2 | |
| import torch | |
| import numpy as np | |
| from pathlib import Path | |
| import numpy as np | |
| from numpy import array | |
| import pandas as pd | |
| import matplotlib.pyplot as plt | |
| import string | |
| import os | |
| from PIL import Image | |
| import glob | |
| import imageio | |
| import random | |
| import pickle | |
| from pickle import dump, load | |
| from time import time | |
| from keras.preprocessing import sequence | |
| from keras.models import Sequential | |
| from keras.layers import LSTM, Embedding, TimeDistributed, Dense, RepeatVector,\ | |
| Activation, Flatten, Reshape, concatenate, Dropout, BatchNormalization | |
| from keras.optimizers import Adam, RMSprop | |
| from keras.layers import Bidirectional | |
| from keras.layers import add | |
| from keras.preprocessing import image | |
| from keras.models import Model | |
| from keras import Input, layers | |
| from keras import optimizers | |
| from keras.preprocessing.sequence import pad_sequences | |
| app = FastAPI() | |
| app.mount("/static", StaticFiles(directory="app/static"), name="static") | |
| templates = Jinja2Templates(directory="app/templates") | |
| async def home(request: dict = {}): | |
| return templates.TemplateResponse("index.html", {"request": request}) | |
| async def create_upload_file(file: UploadFile = File(...), request: dict = {}): | |
| with open(f"app/static/{file.filename}", "wb") as buffer: | |
| shutil.copyfileobj(file.file, buffer) | |
| # Placeholder image processing logic using PIL (replace with your actual logic) | |
| processed_filename = f"processed_{file.filename}" | |
| processed_file_path = os.path.join("app/static", processed_filename) | |
| global nameforfile | |
| nameforfile=file.filename | |
| return templates.TemplateResponse("after.html",{"request": request,"data":generate_caption(),"input_filename":file.filename}) | |
| max_length=40 | |
| wordtoix={'startseq': 1, 'A': 2, 'child': 3, 'in': 4, 'a': 5, 'pink': 6, 'dress': 7, 'is': 8, 'climbing': 9, 'up': 10, 'set': 11, 'of': 12, 'stairs': 13, 'an': 14, 'way': 15, '.': 16, 'endseq': 17, 'girl': 18, 'going': 19, 'into': 20, 'wooden': 21, 'building': 22, 'little': 23, 'the': 24, 'to': 25, 'her': 26, 'black': 27, 'dog': 28, 'and': 29, 'spotted': 30, 'are': 31, 'fighting': 32, 'tri-colored': 33, 'playing': 34, 'with': 35, 'each': 36, 'other': 37, 'on': 38, 'road': 39, 'white': 40, 'brown': 41, 'spots': 42, 'staring': 43, 'at': 44, 'street': 45, 'Two': 46, 'dogs': 47, 'different': 48, 'looking': 49, 'pavement': 50, 'moving': 51, 'toward': 52, 'covered': 53, 'paint': 54, 'sits': 55, 'front': 56, 'painted': 57, 'rainbow': 58, 'hands': 59, 'bowl': 60, 'sitting': 61, 'large': 62, 'small': 63, 'grass': 64, 'plays': 65, 'it': 66, 'There': 67, 'pigtails': 68, 'painting': 69, 'Young': 70, 'outside': 71, 'man': 72, 'lays': 73, 'bench': 74, 'while': 75, 'his': 76, 'by': 77, 'him': 78, 'which': 79, 'also': 80, 'tied': 81, 'sleeping': 82, 'next': 83, 'shirtless': 84, 'lies': 85, 'park': 86, 'laying': 87, 'holding': 88, 'leash': 89, 'ground': 90, 'orange': 91, 'hat': 92, 'something': 93, 'wears': 94, 'glasses': 95, 'wearing': 96, 'beer': 97, 'can': 98, 'The': 99, 'ears': 100, 'rope': 101, 'net': 102, 'red': 103, 'climbs': 104, 'bridge': 105, 'onto': 106, 'ropes': 107, 'playground': 108, 'running': 109, 'grassy': 110, 'garden': 111, 'surrounded': 112, 'fence': 113, 'through': 114, 'terrier': 115, 'green': 116, 'runs': 117, 'near': 118, 'shakes': 119, 'its': 120, 'head': 121, 'shore': 122, ',': 123, 'ball': 124, 'edge': 125, 'beach': 126, 'Dog': 127, 'feet': 128, 'stands': 129, 'shaking': 130, 'off': 131, 'water': 132, 'White': 133, 'standing': 134, 'turned': 135, 'one': 136, 'side': 137, 'boy': 138, 'smiles': 139, 'wall': 140, 'city': 141, 'overalls': 142, 'working': 143, 'stone': 144, 'young': 145, 'walking': 146, 'paved': 147, 'metal': 148, 'pole': 149, 'behind': 150, 'Smiling': 151, 'shirt': 152, 'blue': 153, 'jeans': 154, 'rock': 155, 'leaps': 156, 'over': 157, 'log': 158, 'grey': 159, 'leaping': 160, 'fallen': 161, 'tree': 162, 'collar': 163, 'jumping': 164, 'jumped': 165, 'stump': 166, 'snow': 167, 'field': 168, 'surface': 169, 'pictures': 170, 'skier': 171, 'skis': 172, 'past': 173, 'another': 174, 'person': 175, 'looks': 176, 'trees': 177, 'Man': 178, 'for': 179, 'cliff': 180, 'group': 181, 'people': 182, 'Seven': 183, 'climbers': 184, 'face': 185, 'whilst': 186, 'Several': 187, 'row': 188, 'watches': 189, 'holds': 190, 'line': 191, 'chases': 192, 'from': 193, 'sprinkler': 194, 'lawn': 195, 'hose': 196, 'Large': 197, 'away': 198, 'prepares': 199, 'catch': 200, 'thrown': 201, 'object': 202, 'nearby': 203, 'cars': 204, 'about': 205, 'yellow': 206, 'mouth': 207, 'toy': 208, 'ready': 209, 'flying': 210, 'air': 211, 'after': 212, 'get': 213, 'jumps': 214, 'towards': 215, 'trying': 216, 'midair': 217, 'couple': 218, 'infant': 219, 'being': 220, 'held': 221, 'male': 222, 'pond': 223, 'stroller': 224, 'sit': 225, 'baby': 226, 'their': 227, 'under': 228, 'facing': 229, 'lake': 230, 'woman': 231, 'along': 232, 'body': 233, 'outdoors': 234, 'surf': 235, 'lab': 236, 'splashes': 237, 'This': 238, 'splashing': 239, 'hole': 240, 'ice': 241, 'frozen': 242, 'men': 243, 'fishing': 244, 'play': 245, 'making': 246, 'turn': 247, 'sand': 248, 'together': 249, 'tan': 250, 'sandy': 251, 'uses': 252, 'climber': 253, 'jacket': 254, 'pants': 255, 'scaling': 256, 'An': 257, 'waterfall': 258, 'two': 259, 'carries': 260, 'as': 261, 'he': 262, 'walks': 263, 'carrying': 264, 'has': 265, 'item': 266, 'wet': 267, 'kayak': 268, 'life': 269, 'jackets': 270, 'rowing': 271, 'canoe': 272, 'waters': 273, 'ride': 274, 'courtyard': 275, 'catching': 276, 'Black': 277, 'driveway': 278, 'art': 279, 'structure': 280, 'glass': 281, 'reads': 282, 'newspaper': 283, 'sculpture': 284, 'office': 285, 'statue': 286, 'backpack': 287, 'buildings': 288, 'reading': 289, 'tent': 290, 'setting': 291, 'snowy': 292, 'very': 293, 'tall': 294, 'distance': 295, 'camera': 296, 'People': 297, 'mountainside': 298, 'out': 299, 'view': 300, 'Three': 301, 'overlooking': 302, 'valley': 303, 'hang': 304, 'top': 305, 'big': 306, 'hill': 307, 'rest': 308, 'ledge': 309, 'above': 310, 'down': 311, 'many': 312, 'inflatable': 313, 'boats': 314, 'railing': 315, 'below': 316, 'crowd': 317, 'jersey': 318, 'pose': 319, 'hand': 320, 'some': 321, 'posing': 322, 'picture': 323, 'Asian': 324, 'blond': 325, 'background': 326, 'Guy': 327, 'biting': 328, 'striped': 329, 'guy': 330, 'several': 331, 'rail': 332, 'crowded': 333, 'takes': 334, 'jump': 335, 'skateboard': 336, 'performing': 337, 'trick': 338, 'leans': 339, 'skateboarder': 340, 'doing': 341, 'board': 342, 'platform': 343, 'paddling': 344, 'river': 345, 'seen': 346, 'kayaking': 347, 'paddles': 348, 'boat': 349, 'paddle': 350, 'shallow': 351, 'girls': 352, 'ocean': 353, 'four': 354, 'children': 355, 'pajamas': 356, 'have': 357, 'pillow': 358, 'fight': 359, 'kids': 360, 'bed': 361, 'Children': 362, 'having': 363, 'Four': 364, 'workers': 365, 'beam': 366, 'taking': 367, 'break': 368, 'construction': 369, 'take': 370, 'seat': 371, 'train': 372, 'rides': 373, 'book': 374, 'Child': 375, 'rocky': 376, 'run': 377, 'across': 378, 'area': 379, 'end': 380, 'high': 381, 'diving': 382, 'pool': 383, 'kid': 384, 'swimming': 385, 'window': 386, 'tank': 387, 'door': 388, 'puts': 389, 'putting': 390, 'hiker': 391, 'mountains': 392, 'ski': 393, "'s": 394, 'landscape': 395, 'snow-covered': 396, 'mountain': 397, 'beautiful': 398, 'mountaintop': 399, 'attempting': 400, 'purple': 401, 'low': 402, 'cut': 403, 'yard': 404, 'Frisbee': 405, 'shorts': 406, 'parking': 407, 'lot': 408, 'middle': 409, 'during': 410, 'heavy': 411, 'traffic': 412, 'mat': 413, 'between': 414, 'open': 415, 'busy': 416, 'terrain': 417, 'One': 418, 'chasing': 419, 'catches': 420, 'tennis': 421, 'watching': 422, 'balloons': 423, 'night': 424, 'hot': 425, 'lit': 426, 'lined': 427, 'helmet': 428, 'bike': 429, 'dirt': 430, 'bicycle': 431, 'race': 432, 'quickly': 433, 'BMX': 434, 'dark': 435, 'throwing': 436, 'bubbles': 437, 'foam': 438, 'ramp': 439, 'getting': 440, 'sticks': 441, 'tongue': 442, 'boys': 443, 'make': 444, 'faces': 445, 'smiling': 446, 'sticking': 447, 'look': 448, 'silly': 449, 'blonde': 450, 'horse': 451, 'sweatshirt': 452, 'fire': 453, 'barrel': 454, 'stand': 455, 'lead': 456, 'horses': 457, 'sheep': 458, 'pushing': 459, 'skinny': 460, 'smaller': 461, 'three': 462, 'them': 463, 'various': 464, 'safety': 465, 'harness': 466, 'indoor': 467, 'rocks': 468, 'Woman': 469, 'ring': 470, 'teenage': 471, 'slide': 472, 'forest': 473, 'skiing': 474, 'wooded': 475, 'cross-country': 476, 'skiers': 477, 'woodland': 478, 'sliding': 479, 'trail': 480, 'woods': 481, 'lone': 482, 'hikers': 483, 'pathway': 484, 'light': 485, 'path': 486, 'happily': 487, 'dressed': 488, 'atop': 489, 'pull': 490, 'cart': 491, 'golden': 492, 'coat': 493, 'pulling': 494, 'carriage': 495, 'sled': 496, 'sheer': 497, 'using': 498, 'flat': 499, 'steep': 500, 'vest': 501, 'inside': 502, 'cave': 503, 'shows': 504, 'sunlight': 505, 'lay': 506, 'dry': 507, 'resting': 508, 'gear': 509, 'chalk': 510, 'stream': 511, 'drawing': 512, 'sidewalk': 513, 'deep': 514, 'pile': 515, 'fountain': 516, 'fountains': 517, 'sprayed': 518, 'tunnel': 519, 'course': 520, 'obstacle': 521, 'around': 522, 'swimsuit': 523, 'arms': 524, 'outstretched': 525, 'Little': 526, 'handrail': 527, 'bathing': 528, 'suit': 529, 'drinking': 530, 'spray': 531, 'soaked': 532, 'jet': 533, 'shower': 534, 'gets': 535, 'underwater': 536, 'swims': 537, 'alone': 538, 'snowmobile': 539, 'flies': 540, 'rider': 541, 'or': 542, 'machine': 543, 'pine': 544, 'rural': 545, 'riding': 546, 'helmets': 547, 'goggles': 548, 'drive': 549, 'heads': 550, 'ATV': 551, 'wheel': 552, 'empty': 553, 'all': 554, 'vehicle': 555, 'airborne': 556, 'soccer': 557, 'arm': 558, 't-shirt': 559, 'Small': 560, 'artist': 561, 'clouds': 562, 'colors': 563, 'paper': 564, 'cyclist': 565, 'sharp': 566, 'curve': 567, 'biker': 568, 'old': 569, 'video': 570, 'Girl': 571, 'lips': 572, 'gun': 573, 'audience': 574, 'watch': 575, 'onlookers': 576, 'toddler': 577, 'shoes': 578, 'attached': 579, 'Person': 580, 'that': 581, 'public': 582, 'wood': 583, 'animal': 584, 'bird': 585, 'eating': 586, 'someone': 587, 'eats': 588, 'finger': 589, 'fast': 590, 'wades': 591, 'laughs': 592, 'colorful': 593, 'outdoor': 594, 'handstand': 595, 'does': 596, 'upside': 597, 'snowboard': 598, 'surfboard': 599, 'bikes': 600, 'traveling': 601, 'motorcycles': 602, 'half': 603, 'naked': 604, 'chair': 605, 'older': 606, 'back': 607, 'relaxes': 608, 'patio': 609, 'where': 610, 'bicycles': 611, 'cap': 612, 'deck': 613, 'close': 614, 'parked': 615, 'relaxing': 616, 'floating': 617, 'mouths': 618, 'tug': 619, 'chew': 620, 'haired': 621, 'drink': 622, 'hair': 623, 'party': 624, 'streets': 625, 'they': 626, 'women': 627, 'parade': 628, 'splash': 629, 'sandals': 630, 'short': 631, 'backpacks': 632, 'cardboard': 633, 'bus': 634, 'station': 635, 'room': 636, 'plants': 637, 'crossing': 638, 'sign': 639, 'beside': 640, 'family': 641, 'gathered': 642, 'van': 643, 'bright': 644, 'truck': 645, 'others': 646, 'helping': 647, 'step': 648, 'pulled': 649, 'brightly': 650, 'poses': 651, 'costume': 652, 'hugs': 653, 'who': 654, 'Blond': 655, 'event': 656, 'hugging': 657, 'bicyclist': 658, 'cross': 659, 'biking': 660, 'lady': 661, 'sky': 662, 'car': 663, 'Women': 664, 'wait': 665, 'jogging': 666, 'jogs': 667, 'headphones': 668, 'plant': 669, 'store': 670, 'corner': 671, 'intersection': 672, 'waiting': 673, 'bikers': 674, 'stop': 675, 'town': 676, 'without': 677, 'wagon': 678, 'leading': 679, 'hits': 680, 'hitting': 681, 'baseball': 682, 'adult': 683, 'put': 684, 'cage': 685, 'spins': 686, 'waves': 687, 'sun': 688, 'she': 689, 'marching': 690, 'band': 691, 'teenager': 692, 'game': 693, 'sneakers': 694, 'leap': 695, 'elderly': 696, 'straw': 697, 'gray': 698, 'sweater': 699, 'walk': 700, 'hallway': 701, 'colored': 702, 'flip': 703, 'flops': 704, 'hood': 705, 'legs': 706, 'boulder': 707, 'clear': 708, 'hooded': 709, 'bending': 710, 'blanket': 711, 'stuffed': 712, 'animals': 713, 'giving': 714, 'toys': 715, 'war': 716, 'floor': 717, 'nose': 718, 'silver': 719, 'closeup': 720, 'bar': 721, 'neon': 722, 'hanging': 723, 'bank': 724, 'computer': 725, 'rough': 726, 'shaped': 727, 'plastic': 728, 'team': 729, 'wear': 730, 'uniforms': 731, 'same': 732, 'hats': 733, 'caps': 734, 'flowers': 735, 'shaggy': 736, 'stick': 737, 'long': 738, 'alongside': 739, 'advertisement': 740, 'subway': 741, 'umbrella': 742, 'unicycle': 743, 'scooter': 744, 'reaches': 745, 'dock': 746, 'pier': 747, 'concrete': 748, 'landing': 749, 'table': 750, 'picnic': 751, 'luggage': 752, 'eat': 753, 'floral': 754, 'purse': 755, 'Dogs': 756, 'suspended': 757, 'type': 758, 'strange': 759, 'eyes': 760, 'closed': 761, 'photo': 762, 'outfit': 763, 'photograph': 764, 'just': 765, 'church': 766, 'climb': 767, 'Many': 768, 'swing': 769, 'swings': 770, 'heels': 771, 'brick': 772, 'against': 773, 'wrestle': 774, 'plain': 775, 'clothes': 776, 'asleep': 777, 'sofa': 778, 'pacifier': 779, 'bear': 780, 'soda': 781, 'drinks': 782, 'print': 783, 'gold': 784, 'stove': 785, 'pipe': 786, 'makeup': 787, 'benches': 788, 'sunglasses': 789, 'mask': 790, 'wetsuit': 791, 'bald': 792, 'flips': 793, 'ear': 794, 'Brown': 795, 'bite': 796, ';': 797, 'number': 798, 'six': 799, 'chased': 800, 'there': 801, 'kneeling': 802, 'approaching': 803, 'thin': 804, 'carpet': 805, 'rug': 806, 'lying': 807, 'furry': 808, 'suits': 809, 'friends': 810, 'smile': 811, 'ladies': 812, 'bikinis': 813, 'reflection': 814, 'asian': 815, 'dances': 816, 'skirt': 817, 'crouches': 818, 'writing': 819, 'descending': 820, 'Girls': 821, 'kicking': 822, 'police': 823, 'motorcycle': 824, 'muddy': 825, 'motorbike': 826, 'uphill': 827, 'motocross': 828, 'racer': 829, 'display': 830, 'underwear': 831, 'wire': 832, 'bicyclists': 833, 'creek': 834, 'leaning': 835, 'motion': 836, 'says': 837, '"': 838, 'sunset': 839, 'float': 840, 'drives': 841, 'waits': 842, 'driving': 843, 'lap': 844, 'tries': 845, 'playpen': 846, 'female': 847, 'Baby': 848, 'football': 849, 'Boy': 850, 'foot': 851, 'first': 852, 'seated': 853, 'candles': 854, 'birthday': 855, 'place': 856, '5': 857, 'cake': 858, 'trotting': 859, 'few': 860, 'adults': 861, 'splashed': 862, 'sunny': 863, 'day': 864, 'lots': 865, 'topless': 866, 'shown': 867, 'cloudy': 868, 'khaki': 869, 'passes': 870, 'sideways': 871, 'performs': 872, 'tricks': 873, 'waterskiing': 874, 'knee': 875, 'begins': 876, 'fall': 877, 'wakeboarding': 878, 'younger': 879, 'fish': 880, 'stare': 881, 'Some': 882, 'pitch': 883, 'uniform': 884, 'player': 885, 'backyard': 886, 'stuck': 887, 'turning': 888, 'wide': 889, 'barks': 890, 'shoulder': 891, 'fluffy': 892, 'grab': 893, 'tables': 894, 'talks': 895, 'showing': 896, 'talking': 897, 'phone': 898, 'cellphone': 899, 'flower': 900, 'attire': 901, 'device': 902, 'american': 903, 'flag': 904, 'American': 905, 'hiking': 906, 'hikes': 907, 'underneath': 908, 'stool': 909, 'chairs': 910, 'gives': 911, 'eye': 912, 'trunks': 913, 'reflective': 914, 'swim': 915, 'block': 916, 'dirty': 917, 'bottle': 918, 'checkered': 919, 'tight': 920, 'bars': 921, 'hangs': 922, 'monkey': 923, 'jungle': 924, 'gym': 925, 'ladder': 926, 'warm': 927, 'swinging': 928, 'wings': 929, 'slides': 930, 'floaties': 931, 'hit': 932, 'jean': 933, 'railroad': 934, 'tracks': 935, 'barefoot': 936, 'bearded': 937, 'peace': 938, 'stops': 939, 'feather': 940, 'shaved': 941, 'shopping': 942, 'filled': 943, 'wave': 944, 'sports': 945, 'attempt': 946, 'five': 947, 'tire': 948, 'racers': 949, 'racing': 950, 'laughing': 951, 'bucket': 952, 'beneath': 953, 'boogie': 954, 'trampoline': 955, 'puppies': 956, 'chase': 957, 'heavily': 958, 'cold': 959, 'but': 960, 'sets': 961, 'balloon': 962, 'figure': 963, 'right': 964, 'slightly': 965, 'floats': 966, 'bikini': 967, 'huge': 968, 'scene': 969, 'skimpy': 970, 'foreground': 971, 'skating': 972, 'helps': 973, 'skate': 974, 'hold': 975, 'go': 976, 'rink': 977, 'museum': 978, 'retriever': 979, 'kissing': 980, 'cheek': 981, 'tie': 982, 'kiss': 983, 'happy': 984, 'both': 985, 'shirts': 986, 'vests': 987, 'formal': 988, 'balcony': 989, 'amusement': 990, 'carnival': 991, 'swords': 992, 'bat': 993, 'cup': 994, 'rubber': 995, 'referee': 996, 'funny': 997, 'bushes': 998, 'matching': 999, 'denim': 1000, 'gravel': 1001, 'land': 1002, 'puppy': 1003, 'beige': 1004, 'left': 1005, 'frame': 1006, 'help': 1007, 'push': 1008, 'among': 1009, 'cement': 1010, 'shop': 1011, 'retrieves': 1012, 'golf': 1013, 'hind': 1014, 'taken': 1015, 'balls': 1016, 'no': 1017, 'fetch': 1018, 'spectators': 1019, 'pitbull': 1020, 'spraying': 1021, 'marker': 1022, 'house': 1023, 'mirror': 1024, 'hoodie': 1025, 'softball': 1026, 'throw': 1027, 'Kids': 1028, 'playfully': 1029, 'tossing': 1030, 'throws': 1031, 'marked': 1032, 'seven': 1033, 'track': 1034, 'circle': 1035, 'camping': 1036, 'equipment': 1037, 'bags': 1038, 'bottom': 1039, 'base': 1040, 'surfing': 1041, 'made': 1042, 'dune': 1043, 'snowboarding': 1044, 'poodle': 1045, 'full': 1046, 'bath': 1047, 'cloth': 1048, 'wading': 1049, 'towel': 1050, 'formation': 1051, 'walkway': 1052, 'enjoying': 1053, 'wine': 1054, 'screen': 1055, 'laptop': 1056, 'snowboarder': 1057, 'Someone': 1058, 'cover': 1059, 'sheet': 1060, 'females': 1061, 'clothing': 1062, 'case': 1063, 'outfits': 1064, 'dresses': 1065, 'fishes': 1066, 'tops': 1067, 'These': 1068, 'you': 1069, 'plaid': 1070, 'bag': 1071, 'speaks': 1072, 'coffee': 1073, 'restaurant': 1074, 'be': 1075, 'only': 1076, 'retrieving': 1077, 'pack': 1078, 'father': 1079, 'peak': 1080, 'like': 1081, 'cowboy': 1082, 'chain': 1083, 'neck': 1084, 'roller': 1085, 'coaster': 1086, 'shot': 1087, 'poles': 1088, 'slope': 1089, 'innertube': 1090, 'tube': 1091, 'boots': 1092, 'brunette': 1093, 'curb': 1094, 'lift': 1095, 'rolling': 1096, 'competing': 1097, 'agility': 1098, 'palm': 1099, 'touch': 1100, 'gentleman': 1101, 'lean': 1102, 'second': 1103, 'themselves': 1104, 'waist': 1105, 'pirate': 1106, 'patch': 1107, 'bandanna': 1108, 'makes': 1109, 'headscarf': 1110, 'catcher': 1111, 'points': 1112, 'pointing': 1113, 'sides': 1114, 'teams': 1115, 'players': 1116, 'volleyball': 1117, 'stares': 1118, 'vendor': 1119, 'preparing': 1120, 'forward': 1121, 'necklace': 1122, 'trunk': 1123, 'weather': 1124, 'guys': 1125, 'touches': 1126, 'brother': 1127, 'reaching': 1128, 'gloves': 1129, 'food': 1130, 'speaking': 1131, 'box': 1132, 'hurdle': 1133, 'pulls': 1134, 'cigarette': 1135, 'fisherman': 1136, 'Mohawk': 1137, 'style': 1138, 'shade': 1139, 'ribbon': 1140, 'karate': 1141, 'martial': 1142, 'arts': 1143, 'practicing': 1144, 'enjoys': 1145, 'German': 1146, 'piece': 1147, 'handles': 1148, 'touching': 1149, 'graffiti': 1150, 'skateboarding': 1151, 'skater': 1152, 'amidst': 1153, 'cloud': 1154, 'kitchen': 1155, 'meal': 1156, 'spread': 1157, 'tattoos': 1158, 'backs': 1159, 'bathroom': 1160, 'mother': 1161, 'feeding': 1162, '2': 1163, 'watched': 1164, 'raising': 1165, 'almost': 1166, 'partially': 1167, 'shoulders': 1168, 'beard': 1169, 'disc': 1170, 'try': 1171, 'attempts': 1172, 'scales': 1173, 'fun': 1174, 'multi-colored': 1175, 'branch': 1176, 'chewing': 1177, 'leafy': 1178, 'teeth': 1179, 'bleachers': 1180, 'third': 1181, 'school': 1182, 'gate': 1183, 'crashing': 1184, 'rapids': 1185, 'cyclists': 1186, 'bottles': 1187, 'Men': 1188, 'athletic': 1189, 'branches': 1190, 'summer': 1191, 'vehicles': 1192, 'bites': 1193, 'steps': 1194, 'bouncing': 1195, 'enclosed': 1196, 'balancing': 1197, 'leg': 1198, 'see': 1199, 'gestures': 1200, 'though': 1201, 'emerges': 1202, 'kayaker': 1203, 'goes': 1204, 'rain': 1205, 'jeep': 1206, 'training': 1207, 'downhill': 1208, 'court': 1209, 'visible': 1210, 'counter': 1211, 'murky': 1212, 'rafting': 1213, 'tires': 1214, 'Closeup': 1215, 'leaves': 1216, 'bounds': 1217, 'skateboards': 1218, 'do': 1219, 'mud': 1220, 'so': 1221, 'narrow': 1222, 'hills': 1223, 'autumn': 1224, 'bare': 1225, 'scuba': 1226, 'coats': 1227, 'ahead': 1228, 'petting': 1229, 'farm': 1230, 'fenced': 1231, 'pen': 1232, 'collie': 1233, 'goat': 1234, 'curly': 1235, 'upside-down': 1236, 'flipping': 1237, 'gather': 1238, 'Five': 1239, 'wrestling': 1240, 'horizon': 1241, 'blurry': 1242, 'kite': 1243, 'countryside': 1244, 'fly': 1245, 'wheelie': 1246, 'homeless': 1247, 'couch': 1248, 'scarf': 1249, 'beads': 1250, "'": 1251, 'slip': 1252, 'barren': 1253, 'skull': 1254, 'dust': 1255, 'blowing': 1256, 'wind': 1257, 'urban': 1258, 'digging': 1259, 'brush': 1260, 'kneels': 1261, 'multicolored': 1262, 'string': 1263, 'rests': 1264, 'not': 1265, 'pouring': 1266, 'hay': 1267, 'fur': 1268, 'listening': 1269, 'fair': 1270, 'image': 1271, 'covering': 1272, 'mound': 1273, 'raised': 1274, 'raises': 1275, 'cricket': 1276, 'singing': 1277, 'sings': 1278, 'microphone': 1279, 'guitar': 1280, 'crawls': 1281, 'knees': 1282, 'snowball': 1283, 'fabric': 1284, 'kicks': 1285, 'teammate': 1286, 'Boys': 1287, 'puddle': 1288, 'opposite': 1289, 'lights': 1290, 'corn': 1291, 'photographer': 1292, 'driver': 1293, 'ridden': 1294, 'professional': 1295, 'aqua': 1296, 'country': 1297, 'flags': 1298, 'boardwalk': 1299, 'link': 1300, 'silhouette': 1301, 'rows': 1302, 'sniffs': 1303, 'sniffing': 1304, 'hoop': 1305, 'motorcyclist': 1306, 'speed': 1307, 'racetrack': 1308, 'position': 1309, 'sea': 1310, 'camouflage': 1311, 'bunch': 1312, 'picking': 1313, 'surfer': 1314, 'surfs': 1315, 'foggy': 1316, 'this': 1317, 'dreadlocks': 1318, 'flowered': 1319, 'staircase': 1320, 'embrace': 1321, 'goal': 1322, 'goalie': 1323, 'fake': 1324, 'races': 1325, 'balances': 1326, 'balance': 1327, 'himself': 1328, 'tricycle': 1329, 'following': 1330, 'Six': 1331, 'hike': 1332, 'tag': 1333, 'stomach': 1334, 'headfirst': 1335, 'shoreline': 1336, 'cat': 1337, 'stripes': 1338, 'swimmer': 1339, 'skinned': 1340, 'neighborhood': 1341, 'larger': 1342, 'living': 1343, 'leashes': 1344, 'reach': 1345, 'costumes': 1346, 'music': 1347, 'sprinklers': 1348, 'logs': 1349, 'itself': 1350, 'single': 1351, 'time': 1352, 'candy': 1353, 'polka': 1354, 'dot': 1355, 'crosswalk': 1356, 'carry': 1357, 'coming': 1358, 'stadium': 1359, 'licking': 1360, 'medium': 1361, 'sized': 1362, 'lounge': 1363, 'cream': 1364, 'follows': 1365, 'owner': 1366, 'pit': 1367, 'still': 1368, 'plate': 1369, 'dead': 1370, 'winter': 1371, 'muzzle': 1372, 'blow': 1373, 'hoops': 1374, 'arcade': 1375, 'home': 1376, 'wrapped': 1377, 'work': 1378, 'caught': 1379, 'spinning': 1380, 'turns': 1381, '4': 1382, 'appears': 1383, 'markings': 1384, 'basketball': 1385, 'rollerblading': 1386, 'inline': 1387, 'Rollerblades': 1388, 'skates': 1389, 'enjoy': 1390, 'basket': 1391, 'desert': 1392, 'porch': 1393, 'hillside': 1394, 'foliage': 1395, 'indoors': 1396, 'teenagers': 1397, 'talk': 1398, 'moves': 1399, 'stage': 1400, 'onstage': 1401, 'perform': 1402, 'snowsuit': 1403, 'licks': 1404, 'poodles': 1405, 'raft': 1406, 'parachute': 1407, 'gathering': 1408, 'duck': 1409, 'collars': 1410, 'cape': 1411, 'greyhound': 1412, 'greyhounds': 1413, 'dusk': 1414, 'surrounding': 1415, 'decorated': 1416, 'Snowboarder': 1417, 'riders': 1418, 'hug': 1419, 'christmas': 1420, 'headband': 1421, 'friend': 1422, 'starting': 1423, 'money': 1424, 'market': 1425, 'grocery': 1426, 'direction': 1427, 'range': 1428, 'casting': 1429, 'chest': 1430, 'protective': 1431, 'identical': 1432, 'breaking': 1433, 'icy': 1434, 'muzzled': 1435, 'buckets': 1436, 'huddle': 1437, 'falling': 1438, 'tail': 1439, 'rear': 1440, 'broken': 1441, 'knit': 1442, 'shepherd': 1443, 'cow': 1444, 'bull': 1445, 'ponytail': 1446, 'what': 1447, 'Shepherd': 1448, 'rolls': 1449, 'paws': 1450, 'snowcapped': 1451, 'crouching': 1452, 'giant': 1453, 'before': 1454, 'toilet': 1455, 'action': 1456, 'pitcher': 1457, 'pigeons': 1458, 'birds': 1459, 'barrier': 1460, 'laugh': 1461, 'wheels': 1462, 'mostly': 1463, '3': 1464, 'swimsuits': 1465, 'smoking': 1466, 'Lady': 1467, 'redheaded': 1468, 'crossed': 1469, 'herself': 1470, 'dives': 1471, 'Santa': 1472, 'Christmas': 1473, 'Older': 1474, 'african': 1475, 'desk': 1476, 'parka': 1477, 'rowboat': 1478, 'roof': 1479, 'worker': 1480, 'cheerleaders': 1481, 'waving': 1482, 'stunt': 1483, 'move': 1484, 'flock': 1485, 'pair': 1486, 'I': 1487, 'grinding': 1488, 'booth': 1489, 'barn': 1490, 'signs': 1491, 'African': 1492, 'backwards': 1493, '8': 1494, 'photographed': 1495, 'pass': 1496, 'guard': 1497, 'officer': 1498, 'bow': 1499, 'target': 1500, 'leads': 1501, 'hurdles': 1502, 'dancing': 1503, 'fancy': 1504, 'violin': 1505, 'doorway': 1506, 'tiger': 1507, 'tattoo': 1508, 'Indian': 1509, 'hockey': 1510, 'surfers': 1511, 'airplane': 1512, 'cones': 1513, 'cone': 1514, 'flames': 1515, 'fingers': 1516, 'leaving': 1517, 'muzzles': 1518, 'sledding': 1519, 'shoveling': 1520, 'shovel': 1521, 'Japanese': 1522, 'class': 1523, 'passing': 1524, 'instrument': 1525, 'Group': 1526, 'mug': 1527, 'smokes': 1528, 'square': 1529, 'dance': 1530, 'meadow': 1531, 'members': 1532, 'umbrellas': 1533, 'boxing': 1534, 'sleeps': 1535, 'kisses': 1536, 'leather': 1537, 'Old': 1538, 'cats': 1539, 'blows': 1540, 'barking': 1541, 'speeds': 1542, 'wedding': 1543, 'bride': 1544, 'comes': 1545, 'grabbing': 1546, 'dribbles': 1547, 'robe': 1548, 'hard': 1549, 'colourful': 1550, 'fetching': 1551, 'crosses': 1552, 'drums': 1553, 'instruments': 1554, 'drum': 1555, 'bounce': 1556, 'shadow': 1557, 'kick': 1558, 'straight': 1559, 'Skateboarder': 1560, 'glove': 1561, 'fireplace': 1562, 'wrestler': 1563, 'bush': 1564, 'natural': 1565, 'digs': 1566, 'part': 1567, 'alley': 1568, 'played': 1569, 'Soccer': 1570, 'rollerskating': 1571, 'been': 1572, 'railings': 1573, 'pet': 1574, 'flute': 1575, 'falls': 1576, 'point': 1577, 'robes': 1578, 'pushes': 1579, 'competition': 1580, 'numbered': 1581, 'thumbs': 1582, 'racquet': 1583, 'racket': 1584, 'ducks': 1585, 'geese': 1586, 'doberman': 1587, 'either': 1588, 'ship': 1589, 'skyline': 1590, 'bend': 1591, 'round': 1592, 'match': 1593, 'plaza': 1594, 'apron': 1595, 'tulips': 1596, 'Oklahoma': 1597, 'Football': 1598, 'Sooners': 1599, 'tackle': 1600, 'coach': 1601, 'strip': 1602, 'fans': 1603, 'tackled': 1604, 'jerseys': 1605, 'tackling': 1606, 'uniformed': 1607, 'cheerleader': 1608, 'blocks': 1609, 'opposing': 1610, 'center': 1611, 'compete': 1612, 'appear': 1613, '#': 1614, 'crying': 1615, 'flight': 1616, 'bathtub': 1617, 'monument': 1618, 'protest': 1619, 'hospital': 1620, 'cast': 1621, 'gallery': 1622, 'wheelchair': 1623, 'show': 1624, 'jumper': 1625, 'jockey': 1626, 'blurred': 1627, 'cafe': 1628, 'banner': 1629, 'how': 1630, 'merry-go-round': 1631, 'tripod': 1632, 'photographs': 1633, 'camel': 1634, 'shooting': 1635, 'bubble': 1636, 'ribbons': 1637, 'sing': 1638, 'hula': 1639, 'advertising': 1640, 'smoke': 1641, 'trashcan': 1642, 'skirts': 1643, 'followed': 1644, 'tutu': 1645, 'boarding': 1646, 'aged': 1647, 'apple': 1648, 'beagle': 1649, 'shoot': 1650, 'shoe': 1651, 'bunny': 1652, 'tents': 1653, 'traditional': 1654, 'control': 1655, 'crouched': 1656, 'eastern': 1657, 'tuxedos': 1658, 'gliding': 1659, 'sail': 1660, 'chews': 1661, 'clown': 1662, 'kiddie': 1663, 'athlete': 1664, 'rollerblader': 1665, 'grinds': 1666, 'sport': 1667, 'rugby': 1668, 'policeman': 1669, 'bmx': 1670, 'rodeo': 1671, 'stretches': 1672, 'stair': 1673, 'students': 1674, 'ridge': 1675, 'runner': 1676, 'accordion': 1677, 'officers': 1678, 'Miami': 1679, 'crane': 1680, 'houses': 1681, 'puck': 1682, 'Obama': 1683, 'bone': 1684, 'swan': 1685, 'plane': 1686, 'masks': 1687, 'groom': 1688, 'mural': 1689, 'daughter': 1690, 'scarves': 1691, 'fruit': 1692, 'military': 1693, 'elephant': 1694, 'wrestlers': 1695, 'cards': 1696, 'sumo': 1697, 'camels': 1698} | |
| ixtoword={1: 'startseq', 2: 'A', 3: 'child', 4: 'in', 5: 'a', 6: 'pink', 7: 'dress', 8: 'is', 9: 'climbing', 10: 'up', 11: 'set', 12: 'of', 13: 'stairs', 14: 'an', 15: 'way', 16: '.', 17: 'endseq', 18: 'girl', 19: 'going', 20: 'into', 21: 'wooden', 22: 'building', 23: 'little', 24: 'the', 25: 'to', 26: 'her', 27: 'black', 28: 'dog', 29: 'and', 30: 'spotted', 31: 'are', 32: 'fighting', 33: 'tri-colored', 34: 'playing', 35: 'with', 36: 'each', 37: 'other', 38: 'on', 39: 'road', 40: 'white', 41: 'brown', 42: 'spots', 43: 'staring', 44: 'at', 45: 'street', 46: 'Two', 47: 'dogs', 48: 'different', 49: 'looking', 50: 'pavement', 51: 'moving', 52: 'toward', 53: 'covered', 54: 'paint', 55: 'sits', 56: 'front', 57: 'painted', 58: 'rainbow', 59: 'hands', 60: 'bowl', 61: 'sitting', 62: 'large', 63: 'small', 64: 'grass', 65: 'plays', 66: 'it', 67: 'There', 68: 'pigtails', 69: 'painting', 70: 'Young', 71: 'outside', 72: 'man', 73: 'lays', 74: 'bench', 75: 'while', 76: 'his', 77: 'by', 78: 'him', 79: 'which', 80: 'also', 81: 'tied', 82: 'sleeping', 83: 'next', 84: 'shirtless', 85: 'lies', 86: 'park', 87: 'laying', 88: 'holding', 89: 'leash', 90: 'ground', 91: 'orange', 92: 'hat', 93: 'something', 94: 'wears', 95: 'glasses', 96: 'wearing', 97: 'beer', 98: 'can', 99: 'The', 100: 'ears', 101: 'rope', 102: 'net', 103: 'red', 104: 'climbs', 105: 'bridge', 106: 'onto', 107: 'ropes', 108: 'playground', 109: 'running', 110: 'grassy', 111: 'garden', 112: 'surrounded', 113: 'fence', 114: 'through', 115: 'terrier', 116: 'green', 117: 'runs', 118: 'near', 119: 'shakes', 120: 'its', 121: 'head', 122: 'shore', 123: ',', 124: 'ball', 125: 'edge', 126: 'beach', 127: 'Dog', 128: 'feet', 129: 'stands', 130: 'shaking', 131: 'off', 132: 'water', 133: 'White', 134: 'standing', 135: 'turned', 136: 'one', 137: 'side', 138: 'boy', 139: 'smiles', 140: 'wall', 141: 'city', 142: 'overalls', 143: 'working', 144: 'stone', 145: 'young', 146: 'walking', 147: 'paved', 148: 'metal', 149: 'pole', 150: 'behind', 151: 'Smiling', 152: 'shirt', 153: 'blue', 154: 'jeans', 155: 'rock', 156: 'leaps', 157: 'over', 158: 'log', 159: 'grey', 160: 'leaping', 161: 'fallen', 162: 'tree', 163: 'collar', 164: 'jumping', 165: 'jumped', 166: 'stump', 167: 'snow', 168: 'field', 169: 'surface', 170: 'pictures', 171: 'skier', 172: 'skis', 173: 'past', 174: 'another', 175: 'person', 176: 'looks', 177: 'trees', 178: 'Man', 179: 'for', 180: 'cliff', 181: 'group', 182: 'people', 183: 'Seven', 184: 'climbers', 185: 'face', 186: 'whilst', 187: 'Several', 188: 'row', 189: 'watches', 190: 'holds', 191: 'line', 192: 'chases', 193: 'from', 194: 'sprinkler', 195: 'lawn', 196: 'hose', 197: 'Large', 198: 'away', 199: 'prepares', 200: 'catch', 201: 'thrown', 202: 'object', 203: 'nearby', 204: 'cars', 205: 'about', 206: 'yellow', 207: 'mouth', 208: 'toy', 209: 'ready', 210: 'flying', 211: 'air', 212: 'after', 213: 'get', 214: 'jumps', 215: 'towards', 216: 'trying', 217: 'midair', 218: 'couple', 219: 'infant', 220: 'being', 221: 'held', 222: 'male', 223: 'pond', 224: 'stroller', 225: 'sit', 226: 'baby', 227: 'their', 228: 'under', 229: 'facing', 230: 'lake', 231: 'woman', 232: 'along', 233: 'body', 234: 'outdoors', 235: 'surf', 236: 'lab', 237: 'splashes', 238: 'This', 239: 'splashing', 240: 'hole', 241: 'ice', 242: 'frozen', 243: 'men', 244: 'fishing', 245: 'play', 246: 'making', 247: 'turn', 248: 'sand', 249: 'together', 250: 'tan', 251: 'sandy', 252: 'uses', 253: 'climber', 254: 'jacket', 255: 'pants', 256: 'scaling', 257: 'An', 258: 'waterfall', 259: 'two', 260: 'carries', 261: 'as', 262: 'he', 263: 'walks', 264: 'carrying', 265: 'has', 266: 'item', 267: 'wet', 268: 'kayak', 269: 'life', 270: 'jackets', 271: 'rowing', 272: 'canoe', 273: 'waters', 274: 'ride', 275: 'courtyard', 276: 'catching', 277: 'Black', 278: 'driveway', 279: 'art', 280: 'structure', 281: 'glass', 282: 'reads', 283: 'newspaper', 284: 'sculpture', 285: 'office', 286: 'statue', 287: 'backpack', 288: 'buildings', 289: 'reading', 290: 'tent', 291: 'setting', 292: 'snowy', 293: 'very', 294: 'tall', 295: 'distance', 296: 'camera', 297: 'People', 298: 'mountainside', 299: 'out', 300: 'view', 301: 'Three', 302: 'overlooking', 303: 'valley', 304: 'hang', 305: 'top', 306: 'big', 307: 'hill', 308: 'rest', 309: 'ledge', 310: 'above', 311: 'down', 312: 'many', 313: 'inflatable', 314: 'boats', 315: 'railing', 316: 'below', 317: 'crowd', 318: 'jersey', 319: 'pose', 320: 'hand', 321: 'some', 322: 'posing', 323: 'picture', 324: 'Asian', 325: 'blond', 326: 'background', 327: 'Guy', 328: 'biting', 329: 'striped', 330: 'guy', 331: 'several', 332: 'rail', 333: 'crowded', 334: 'takes', 335: 'jump', 336: 'skateboard', 337: 'performing', 338: 'trick', 339: 'leans', 340: 'skateboarder', 341: 'doing', 342: 'board', 343: 'platform', 344: 'paddling', 345: 'river', 346: 'seen', 347: 'kayaking', 348: 'paddles', 349: 'boat', 350: 'paddle', 351: 'shallow', 352: 'girls', 353: 'ocean', 354: 'four', 355: 'children', 356: 'pajamas', 357: 'have', 358: 'pillow', 359: 'fight', 360: 'kids', 361: 'bed', 362: 'Children', 363: 'having', 364: 'Four', 365: 'workers', 366: 'beam', 367: 'taking', 368: 'break', 369: 'construction', 370: 'take', 371: 'seat', 372: 'train', 373: 'rides', 374: 'book', 375: 'Child', 376: 'rocky', 377: 'run', 378: 'across', 379: 'area', 380: 'end', 381: 'high', 382: 'diving', 383: 'pool', 384: 'kid', 385: 'swimming', 386: 'window', 387: 'tank', 388: 'door', 389: 'puts', 390: 'putting', 391: 'hiker', 392: 'mountains', 393: 'ski', 394: "'s", 395: 'landscape', 396: 'snow-covered', 397: 'mountain', 398: 'beautiful', 399: 'mountaintop', 400: 'attempting', 401: 'purple', 402: 'low', 403: 'cut', 404: 'yard', 405: 'Frisbee', 406: 'shorts', 407: 'parking', 408: 'lot', 409: 'middle', 410: 'during', 411: 'heavy', 412: 'traffic', 413: 'mat', 414: 'between', 415: 'open', 416: 'busy', 417: 'terrain', 418: 'One', 419: 'chasing', 420: 'catches', 421: 'tennis', 422: 'watching', 423: 'balloons', 424: 'night', 425: 'hot', 426: 'lit', 427: 'lined', 428: 'helmet', 429: 'bike', 430: 'dirt', 431: 'bicycle', 432: 'race', 433: 'quickly', 434: 'BMX', 435: 'dark', 436: 'throwing', 437: 'bubbles', 438: 'foam', 439: 'ramp', 440: 'getting', 441: 'sticks', 442: 'tongue', 443: 'boys', 444: 'make', 445: 'faces', 446: 'smiling', 447: 'sticking', 448: 'look', 449: 'silly', 450: 'blonde', 451: 'horse', 452: 'sweatshirt', 453: 'fire', 454: 'barrel', 455: 'stand', 456: 'lead', 457: 'horses', 458: 'sheep', 459: 'pushing', 460: 'skinny', 461: 'smaller', 462: 'three', 463: 'them', 464: 'various', 465: 'safety', 466: 'harness', 467: 'indoor', 468: 'rocks', 469: 'Woman', 470: 'ring', 471: 'teenage', 472: 'slide', 473: 'forest', 474: 'skiing', 475: 'wooded', 476: 'cross-country', 477: 'skiers', 478: 'woodland', 479: 'sliding', 480: 'trail', 481: 'woods', 482: 'lone', 483: 'hikers', 484: 'pathway', 485: 'light', 486: 'path', 487: 'happily', 488: 'dressed', 489: 'atop', 490: 'pull', 491: 'cart', 492: 'golden', 493: 'coat', 494: 'pulling', 495: 'carriage', 496: 'sled', 497: 'sheer', 498: 'using', 499: 'flat', 500: 'steep', 501: 'vest', 502: 'inside', 503: 'cave', 504: 'shows', 505: 'sunlight', 506: 'lay', 507: 'dry', 508: 'resting', 509: 'gear', 510: 'chalk', 511: 'stream', 512: 'drawing', 513: 'sidewalk', 514: 'deep', 515: 'pile', 516: 'fountain', 517: 'fountains', 518: 'sprayed', 519: 'tunnel', 520: 'course', 521: 'obstacle', 522: 'around', 523: 'swimsuit', 524: 'arms', 525: 'outstretched', 526: 'Little', 527: 'handrail', 528: 'bathing', 529: 'suit', 530: 'drinking', 531: 'spray', 532: 'soaked', 533: 'jet', 534: 'shower', 535: 'gets', 536: 'underwater', 537: 'swims', 538: 'alone', 539: 'snowmobile', 540: 'flies', 541: 'rider', 542: 'or', 543: 'machine', 544: 'pine', 545: 'rural', 546: 'riding', 547: 'helmets', 548: 'goggles', 549: 'drive', 550: 'heads', 551: 'ATV', 552: 'wheel', 553: 'empty', 554: 'all', 555: 'vehicle', 556: 'airborne', 557: 'soccer', 558: 'arm', 559: 't-shirt', 560: 'Small', 561: 'artist', 562: 'clouds', 563: 'colors', 564: 'paper', 565: 'cyclist', 566: 'sharp', 567: 'curve', 568: 'biker', 569: 'old', 570: 'video', 571: 'Girl', 572: 'lips', 573: 'gun', 574: 'audience', 575: 'watch', 576: 'onlookers', 577: 'toddler', 578: 'shoes', 579: 'attached', 580: 'Person', 581: 'that', 582: 'public', 583: 'wood', 584: 'animal', 585: 'bird', 586: 'eating', 587: 'someone', 588: 'eats', 589: 'finger', 590: 'fast', 591: 'wades', 592: 'laughs', 593: 'colorful', 594: 'outdoor', 595: 'handstand', 596: 'does', 597: 'upside', 598: 'snowboard', 599: 'surfboard', 600: 'bikes', 601: 'traveling', 602: 'motorcycles', 603: 'half', 604: 'naked', 605: 'chair', 606: 'older', 607: 'back', 608: 'relaxes', 609: 'patio', 610: 'where', 611: 'bicycles', 612: 'cap', 613: 'deck', 614: 'close', 615: 'parked', 616: 'relaxing', 617: 'floating', 618: 'mouths', 619: 'tug', 620: 'chew', 621: 'haired', 622: 'drink', 623: 'hair', 624: 'party', 625: 'streets', 626: 'they', 627: 'women', 628: 'parade', 629: 'splash', 630: 'sandals', 631: 'short', 632: 'backpacks', 633: 'cardboard', 634: 'bus', 635: 'station', 636: 'room', 637: 'plants', 638: 'crossing', 639: 'sign', 640: 'beside', 641: 'family', 642: 'gathered', 643: 'van', 644: 'bright', 645: 'truck', 646: 'others', 647: 'helping', 648: 'step', 649: 'pulled', 650: 'brightly', 651: 'poses', 652: 'costume', 653: 'hugs', 654: 'who', 655: 'Blond', 656: 'event', 657: 'hugging', 658: 'bicyclist', 659: 'cross', 660: 'biking', 661: 'lady', 662: 'sky', 663: 'car', 664: 'Women', 665: 'wait', 666: 'jogging', 667: 'jogs', 668: 'headphones', 669: 'plant', 670: 'store', 671: 'corner', 672: 'intersection', 673: 'waiting', 674: 'bikers', 675: 'stop', 676: 'town', 677: 'without', 678: 'wagon', 679: 'leading', 680: 'hits', 681: 'hitting', 682: 'baseball', 683: 'adult', 684: 'put', 685: 'cage', 686: 'spins', 687: 'waves', 688: 'sun', 689: 'she', 690: 'marching', 691: 'band', 692: 'teenager', 693: 'game', 694: 'sneakers', 695: 'leap', 696: 'elderly', 697: 'straw', 698: 'gray', 699: 'sweater', 700: 'walk', 701: 'hallway', 702: 'colored', 703: 'flip', 704: 'flops', 705: 'hood', 706: 'legs', 707: 'boulder', 708: 'clear', 709: 'hooded', 710: 'bending', 711: 'blanket', 712: 'stuffed', 713: 'animals', 714: 'giving', 715: 'toys', 716: 'war', 717: 'floor', 718: 'nose', 719: 'silver', 720: 'closeup', 721: 'bar', 722: 'neon', 723: 'hanging', 724: 'bank', 725: 'computer', 726: 'rough', 727: 'shaped', 728: 'plastic', 729: 'team', 730: 'wear', 731: 'uniforms', 732: 'same', 733: 'hats', 734: 'caps', 735: 'flowers', 736: 'shaggy', 737: 'stick', 738: 'long', 739: 'alongside', 740: 'advertisement', 741: 'subway', 742: 'umbrella', 743: 'unicycle', 744: 'scooter', 745: 'reaches', 746: 'dock', 747: 'pier', 748: 'concrete', 749: 'landing', 750: 'table', 751: 'picnic', 752: 'luggage', 753: 'eat', 754: 'floral', 755: 'purse', 756: 'Dogs', 757: 'suspended', 758: 'type', 759: 'strange', 760: 'eyes', 761: 'closed', 762: 'photo', 763: 'outfit', 764: 'photograph', 765: 'just', 766: 'church', 767: 'climb', 768: 'Many', 769: 'swing', 770: 'swings', 771: 'heels', 772: 'brick', 773: 'against', 774: 'wrestle', 775: 'plain', 776: 'clothes', 777: 'asleep', 778: 'sofa', 779: 'pacifier', 780: 'bear', 781: 'soda', 782: 'drinks', 783: 'print', 784: 'gold', 785: 'stove', 786: 'pipe', 787: 'makeup', 788: 'benches', 789: 'sunglasses', 790: 'mask', 791: 'wetsuit', 792: 'bald', 793: 'flips', 794: 'ear', 795: 'Brown', 796: 'bite', 797: ';', 798: 'number', 799: 'six', 800: 'chased', 801: 'there', 802: 'kneeling', 803: 'approaching', 804: 'thin', 805: 'carpet', 806: 'rug', 807: 'lying', 808: 'furry', 809: 'suits', 810: 'friends', 811: 'smile', 812: 'ladies', 813: 'bikinis', 814: 'reflection', 815: 'asian', 816: 'dances', 817: 'skirt', 818: 'crouches', 819: 'writing', 820: 'descending', 821: 'Girls', 822: 'kicking', 823: 'police', 824: 'motorcycle', 825: 'muddy', 826: 'motorbike', 827: 'uphill', 828: 'motocross', 829: 'racer', 830: 'display', 831: 'underwear', 832: 'wire', 833: 'bicyclists', 834: 'creek', 835: 'leaning', 836: 'motion', 837: 'says', 838: '"', 839: 'sunset', 840: 'float', 841: 'drives', 842: 'waits', 843: 'driving', 844: 'lap', 845: 'tries', 846: 'playpen', 847: 'female', 848: 'Baby', 849: 'football', 850: 'Boy', 851: 'foot', 852: 'first', 853: 'seated', 854: 'candles', 855: 'birthday', 856: 'place', 857: '5', 858: 'cake', 859: 'trotting', 860: 'few', 861: 'adults', 862: 'splashed', 863: 'sunny', 864: 'day', 865: 'lots', 866: 'topless', 867: 'shown', 868: 'cloudy', 869: 'khaki', 870: 'passes', 871: 'sideways', 872: 'performs', 873: 'tricks', 874: 'waterskiing', 875: 'knee', 876: 'begins', 877: 'fall', 878: 'wakeboarding', 879: 'younger', 880: 'fish', 881: 'stare', 882: 'Some', 883: 'pitch', 884: 'uniform', 885: 'player', 886: 'backyard', 887: 'stuck', 888: 'turning', 889: 'wide', 890: 'barks', 891: 'shoulder', 892: 'fluffy', 893: 'grab', 894: 'tables', 895: 'talks', 896: 'showing', 897: 'talking', 898: 'phone', 899: 'cellphone', 900: 'flower', 901: 'attire', 902: 'device', 903: 'american', 904: 'flag', 905: 'American', 906: 'hiking', 907: 'hikes', 908: 'underneath', 909: 'stool', 910: 'chairs', 911: 'gives', 912: 'eye', 913: 'trunks', 914: 'reflective', 915: 'swim', 916: 'block', 917: 'dirty', 918: 'bottle', 919: 'checkered', 920: 'tight', 921: 'bars', 922: 'hangs', 923: 'monkey', 924: 'jungle', 925: 'gym', 926: 'ladder', 927: 'warm', 928: 'swinging', 929: 'wings', 930: 'slides', 931: 'floaties', 932: 'hit', 933: 'jean', 934: 'railroad', 935: 'tracks', 936: 'barefoot', 937: 'bearded', 938: 'peace', 939: 'stops', 940: 'feather', 941: 'shaved', 942: 'shopping', 943: 'filled', 944: 'wave', 945: 'sports', 946: 'attempt', 947: 'five', 948: 'tire', 949: 'racers', 950: 'racing', 951: 'laughing', 952: 'bucket', 953: 'beneath', 954: 'boogie', 955: 'trampoline', 956: 'puppies', 957: 'chase', 958: 'heavily', 959: 'cold', 960: 'but', 961: 'sets', 962: 'balloon', 963: 'figure', 964: 'right', 965: 'slightly', 966: 'floats', 967: 'bikini', 968: 'huge', 969: 'scene', 970: 'skimpy', 971: 'foreground', 972: 'skating', 973: 'helps', 974: 'skate', 975: 'hold', 976: 'go', 977: 'rink', 978: 'museum', 979: 'retriever', 980: 'kissing', 981: 'cheek', 982: 'tie', 983: 'kiss', 984: 'happy', 985: 'both', 986: 'shirts', 987: 'vests', 988: 'formal', 989: 'balcony', 990: 'amusement', 991: 'carnival', 992: 'swords', 993: 'bat', 994: 'cup', 995: 'rubber', 996: 'referee', 997: 'funny', 998: 'bushes', 999: 'matching', 1000: 'denim', 1001: 'gravel', 1002: 'land', 1003: 'puppy', 1004: 'beige', 1005: 'left', 1006: 'frame', 1007: 'help', 1008: 'push', 1009: 'among', 1010: 'cement', 1011: 'shop', 1012: 'retrieves', 1013: 'golf', 1014: 'hind', 1015: 'taken', 1016: 'balls', 1017: 'no', 1018: 'fetch', 1019: 'spectators', 1020: 'pitbull', 1021: 'spraying', 1022: 'marker', 1023: 'house', 1024: 'mirror', 1025: 'hoodie', 1026: 'softball', 1027: 'throw', 1028: 'Kids', 1029: 'playfully', 1030: 'tossing', 1031: 'throws', 1032: 'marked', 1033: 'seven', 1034: 'track', 1035: 'circle', 1036: 'camping', 1037: 'equipment', 1038: 'bags', 1039: 'bottom', 1040: 'base', 1041: 'surfing', 1042: 'made', 1043: 'dune', 1044: 'snowboarding', 1045: 'poodle', 1046: 'full', 1047: 'bath', 1048: 'cloth', 1049: 'wading', 1050: 'towel', 1051: 'formation', 1052: 'walkway', 1053: 'enjoying', 1054: 'wine', 1055: 'screen', 1056: 'laptop', 1057: 'snowboarder', 1058: 'Someone', 1059: 'cover', 1060: 'sheet', 1061: 'females', 1062: 'clothing', 1063: 'case', 1064: 'outfits', 1065: 'dresses', 1066: 'fishes', 1067: 'tops', 1068: 'These', 1069: 'you', 1070: 'plaid', 1071: 'bag', 1072: 'speaks', 1073: 'coffee', 1074: 'restaurant', 1075: 'be', 1076: 'only', 1077: 'retrieving', 1078: 'pack', 1079: 'father', 1080: 'peak', 1081: 'like', 1082: 'cowboy', 1083: 'chain', 1084: 'neck', 1085: 'roller', 1086: 'coaster', 1087: 'shot', 1088: 'poles', 1089: 'slope', 1090: 'innertube', 1091: 'tube', 1092: 'boots', 1093: 'brunette', 1094: 'curb', 1095: 'lift', 1096: 'rolling', 1097: 'competing', 1098: 'agility', 1099: 'palm', 1100: 'touch', 1101: 'gentleman', 1102: 'lean', 1103: 'second', 1104: 'themselves', 1105: 'waist', 1106: 'pirate', 1107: 'patch', 1108: 'bandanna', 1109: 'makes', 1110: 'headscarf', 1111: 'catcher', 1112: 'points', 1113: 'pointing', 1114: 'sides', 1115: 'teams', 1116: 'players', 1117: 'volleyball', 1118: 'stares', 1119: 'vendor', 1120: 'preparing', 1121: 'forward', 1122: 'necklace', 1123: 'trunk', 1124: 'weather', 1125: 'guys', 1126: 'touches', 1127: 'brother', 1128: 'reaching', 1129: 'gloves', 1130: 'food', 1131: 'speaking', 1132: 'box', 1133: 'hurdle', 1134: 'pulls', 1135: 'cigarette', 1136: 'fisherman', 1137: 'Mohawk', 1138: 'style', 1139: 'shade', 1140: 'ribbon', 1141: 'karate', 1142: 'martial', 1143: 'arts', 1144: 'practicing', 1145: 'enjoys', 1146: 'German', 1147: 'piece', 1148: 'handles', 1149: 'touching', 1150: 'graffiti', 1151: 'skateboarding', 1152: 'skater', 1153: 'amidst', 1154: 'cloud', 1155: 'kitchen', 1156: 'meal', 1157: 'spread', 1158: 'tattoos', 1159: 'backs', 1160: 'bathroom', 1161: 'mother', 1162: 'feeding', 1163: '2', 1164: 'watched', 1165: 'raising', 1166: 'almost', 1167: 'partially', 1168: 'shoulders', 1169: 'beard', 1170: 'disc', 1171: 'try', 1172: 'attempts', 1173: 'scales', 1174: 'fun', 1175: 'multi-colored', 1176: 'branch', 1177: 'chewing', 1178: 'leafy', 1179: 'teeth', 1180: 'bleachers', 1181: 'third', 1182: 'school', 1183: 'gate', 1184: 'crashing', 1185: 'rapids', 1186: 'cyclists', 1187: 'bottles', 1188: 'Men', 1189: 'athletic', 1190: 'branches', 1191: 'summer', 1192: 'vehicles', 1193: 'bites', 1194: 'steps', 1195: 'bouncing', 1196: 'enclosed', 1197: 'balancing', 1198: 'leg', 1199: 'see', 1200: 'gestures', 1201: 'though', 1202: 'emerges', 1203: 'kayaker', 1204: 'goes', 1205: 'rain', 1206: 'jeep', 1207: 'training', 1208: 'downhill', 1209: 'court', 1210: 'visible', 1211: 'counter', 1212: 'murky', 1213: 'rafting', 1214: 'tires', 1215: 'Closeup', 1216: 'leaves', 1217: 'bounds', 1218: 'skateboards', 1219: 'do', 1220: 'mud', 1221: 'so', 1222: 'narrow', 1223: 'hills', 1224: 'autumn', 1225: 'bare', 1226: 'scuba', 1227: 'coats', 1228: 'ahead', 1229: 'petting', 1230: 'farm', 1231: 'fenced', 1232: 'pen', 1233: 'collie', 1234: 'goat', 1235: 'curly', 1236: 'upside-down', 1237: 'flipping', 1238: 'gather', 1239: 'Five', 1240: 'wrestling', 1241: 'horizon', 1242: 'blurry', 1243: 'kite', 1244: 'countryside', 1245: 'fly', 1246: 'wheelie', 1247: 'homeless', 1248: 'couch', 1249: 'scarf', 1250: 'beads', 1251: "'", 1252: 'slip', 1253: 'barren', 1254: 'skull', 1255: 'dust', 1256: 'blowing', 1257: 'wind', 1258: 'urban', 1259: 'digging', 1260: 'brush', 1261: 'kneels', 1262: 'multicolored', 1263: 'string', 1264: 'rests', 1265: 'not', 1266: 'pouring', 1267: 'hay', 1268: 'fur', 1269: 'listening', 1270: 'fair', 1271: 'image', 1272: 'covering', 1273: 'mound', 1274: 'raised', 1275: 'raises', 1276: 'cricket', 1277: 'singing', 1278: 'sings', 1279: 'microphone', 1280: 'guitar', 1281: 'crawls', 1282: 'knees', 1283: 'snowball', 1284: 'fabric', 1285: 'kicks', 1286: 'teammate', 1287: 'Boys', 1288: 'puddle', 1289: 'opposite', 1290: 'lights', 1291: 'corn', 1292: 'photographer', 1293: 'driver', 1294: 'ridden', 1295: 'professional', 1296: 'aqua', 1297: 'country', 1298: 'flags', 1299: 'boardwalk', 1300: 'link', 1301: 'silhouette', 1302: 'rows', 1303: 'sniffs', 1304: 'sniffing', 1305: 'hoop', 1306: 'motorcyclist', 1307: 'speed', 1308: 'racetrack', 1309: 'position', 1310: 'sea', 1311: 'camouflage', 1312: 'bunch', 1313: 'picking', 1314: 'surfer', 1315: 'surfs', 1316: 'foggy', 1317: 'this', 1318: 'dreadlocks', 1319: 'flowered', 1320: 'staircase', 1321: 'embrace', 1322: 'goal', 1323: 'goalie', 1324: 'fake', 1325: 'races', 1326: 'balances', 1327: 'balance', 1328: 'himself', 1329: 'tricycle', 1330: 'following', 1331: 'Six', 1332: 'hike', 1333: 'tag', 1334: 'stomach', 1335: 'headfirst', 1336: 'shoreline', 1337: 'cat', 1338: 'stripes', 1339: 'swimmer', 1340: 'skinned', 1341: 'neighborhood', 1342: 'larger', 1343: 'living', 1344: 'leashes', 1345: 'reach', 1346: 'costumes', 1347: 'music', 1348: 'sprinklers', 1349: 'logs', 1350: 'itself', 1351: 'single', 1352: 'time', 1353: 'candy', 1354: 'polka', 1355: 'dot', 1356: 'crosswalk', 1357: 'carry', 1358: 'coming', 1359: 'stadium', 1360: 'licking', 1361: 'medium', 1362: 'sized', 1363: 'lounge', 1364: 'cream', 1365: 'follows', 1366: 'owner', 1367: 'pit', 1368: 'still', 1369: 'plate', 1370: 'dead', 1371: 'winter', 1372: 'muzzle', 1373: 'blow', 1374: 'hoops', 1375: 'arcade', 1376: 'home', 1377: 'wrapped', 1378: 'work', 1379: 'caught', 1380: 'spinning', 1381: 'turns', 1382: '4', 1383: 'appears', 1384: 'markings', 1385: 'basketball', 1386: 'rollerblading', 1387: 'inline', 1388: 'Rollerblades', 1389: 'skates', 1390: 'enjoy', 1391: 'basket', 1392: 'desert', 1393: 'porch', 1394: 'hillside', 1395: 'foliage', 1396: 'indoors', 1397: 'teenagers', 1398: 'talk', 1399: 'moves', 1400: 'stage', 1401: 'onstage', 1402: 'perform', 1403: 'snowsuit', 1404: 'licks', 1405: 'poodles', 1406: 'raft', 1407: 'parachute', 1408: 'gathering', 1409: 'duck', 1410: 'collars', 1411: 'cape', 1412: 'greyhound', 1413: 'greyhounds', 1414: 'dusk', 1415: 'surrounding', 1416: 'decorated', 1417: 'Snowboarder', 1418: 'riders', 1419: 'hug', 1420: 'christmas', 1421: 'headband', 1422: 'friend', 1423: 'starting', 1424: 'money', 1425: 'market', 1426: 'grocery', 1427: 'direction', 1428: 'range', 1429: 'casting', 1430: 'chest', 1431: 'protective', 1432: 'identical', 1433: 'breaking', 1434: 'icy', 1435: 'muzzled', 1436: 'buckets', 1437: 'huddle', 1438: 'falling', 1439: 'tail', 1440: 'rear', 1441: 'broken', 1442: 'knit', 1443: 'shepherd', 1444: 'cow', 1445: 'bull', 1446: 'ponytail', 1447: 'what', 1448: 'Shepherd', 1449: 'rolls', 1450: 'paws', 1451: 'snowcapped', 1452: 'crouching', 1453: 'giant', 1454: 'before', 1455: 'toilet', 1456: 'action', 1457: 'pitcher', 1458: 'pigeons', 1459: 'birds', 1460: 'barrier', 1461: 'laugh', 1462: 'wheels', 1463: 'mostly', 1464: '3', 1465: 'swimsuits', 1466: 'smoking', 1467: 'Lady', 1468: 'redheaded', 1469: 'crossed', 1470: 'herself', 1471: 'dives', 1472: 'Santa', 1473: 'Christmas', 1474: 'Older', 1475: 'african', 1476: 'desk', 1477: 'parka', 1478: 'rowboat', 1479: 'roof', 1480: 'worker', 1481: 'cheerleaders', 1482: 'waving', 1483: 'stunt', 1484: 'move', 1485: 'flock', 1486: 'pair', 1487: 'I', 1488: 'grinding', 1489: 'booth', 1490: 'barn', 1491: 'signs', 1492: 'African', 1493: 'backwards', 1494: '8', 1495: 'photographed', 1496: 'pass', 1497: 'guard', 1498: 'officer', 1499: 'bow', 1500: 'target', 1501: 'leads', 1502: 'hurdles', 1503: 'dancing', 1504: 'fancy', 1505: 'violin', 1506: 'doorway', 1507: 'tiger', 1508: 'tattoo', 1509: 'Indian', 1510: 'hockey', 1511: 'surfers', 1512: 'airplane', 1513: 'cones', 1514: 'cone', 1515: 'flames', 1516: 'fingers', 1517: 'leaving', 1518: 'muzzles', 1519: 'sledding', 1520: 'shoveling', 1521: 'shovel', 1522: 'Japanese', 1523: 'class', 1524: 'passing', 1525: 'instrument', 1526: 'Group', 1527: 'mug', 1528: 'smokes', 1529: 'square', 1530: 'dance', 1531: 'meadow', 1532: 'members', 1533: 'umbrellas', 1534: 'boxing', 1535: 'sleeps', 1536: 'kisses', 1537: 'leather', 1538: 'Old', 1539: 'cats', 1540: 'blows', 1541: 'barking', 1542: 'speeds', 1543: 'wedding', 1544: 'bride', 1545: 'comes', 1546: 'grabbing', 1547: 'dribbles', 1548: 'robe', 1549: 'hard', 1550: 'colourful', 1551: 'fetching', 1552: 'crosses', 1553: 'drums', 1554: 'instruments', 1555: 'drum', 1556: 'bounce', 1557: 'shadow', 1558: 'kick', 1559: 'straight', 1560: 'Skateboarder', 1561: 'glove', 1562: 'fireplace', 1563: 'wrestler', 1564: 'bush', 1565: 'natural', 1566: 'digs', 1567: 'part', 1568: 'alley', 1569: 'played', 1570: 'Soccer', 1571: 'rollerskating', 1572: 'been', 1573: 'railings', 1574: 'pet', 1575: 'flute', 1576: 'falls', 1577: 'point', 1578: 'robes', 1579: 'pushes', 1580: 'competition', 1581: 'numbered', 1582: 'thumbs', 1583: 'racquet', 1584: 'racket', 1585: 'ducks', 1586: 'geese', 1587: 'doberman', 1588: 'either', 1589: 'ship', 1590: 'skyline', 1591: 'bend', 1592: 'round', 1593: 'match', 1594: 'plaza', 1595: 'apron', 1596: 'tulips', 1597: 'Oklahoma', 1598: 'Football', 1599: 'Sooners', 1600: 'tackle', 1601: 'coach', 1602: 'strip', 1603: 'fans', 1604: 'tackled', 1605: 'jerseys', 1606: 'tackling', 1607: 'uniformed', 1608: 'cheerleader', 1609: 'blocks', 1610: 'opposing', 1611: 'center', 1612: 'compete', 1613: 'appear', 1614: '#', 1615: 'crying', 1616: 'flight', 1617: 'bathtub', 1618: 'monument', 1619: 'protest', 1620: 'hospital', 1621: 'cast', 1622: 'gallery', 1623: 'wheelchair', 1624: 'show', 1625: 'jumper', 1626: 'jockey', 1627: 'blurred', 1628: 'cafe', 1629: 'banner', 1630: 'how', 1631: 'merry-go-round', 1632: 'tripod', 1633: 'photographs', 1634: 'camel', 1635: 'shooting', 1636: 'bubble', 1637: 'ribbons', 1638: 'sing', 1639: 'hula', 1640: 'advertising', 1641: 'smoke', 1642: 'trashcan', 1643: 'skirts', 1644: 'followed', 1645: 'tutu', 1646: 'boarding', 1647: 'aged', 1648: 'apple', 1649: 'beagle', 1650: 'shoot', 1651: 'shoe', 1652: 'bunny', 1653: 'tents', 1654: 'traditional', 1655: 'control', 1656: 'crouched', 1657: 'eastern', 1658: 'tuxedos', 1659: 'gliding', 1660: 'sail', 1661: 'chews', 1662: 'clown', 1663: 'kiddie', 1664: 'athlete', 1665: 'rollerblader', 1666: 'grinds', 1667: 'sport', 1668: 'rugby', 1669: 'policeman', 1670: 'bmx', 1671: 'rodeo', 1672: 'stretches', 1673: 'stair', 1674: 'students', 1675: 'ridge', 1676: 'runner', 1677: 'accordion', 1678: 'officers', 1679: 'Miami', 1680: 'crane', 1681: 'houses', 1682: 'puck', 1683: 'Obama', 1684: 'bone', 1685: 'swan', 1686: 'plane', 1687: 'masks', 1688: 'groom', 1689: 'mural', 1690: 'daughter', 1691: 'scarves', 1692: 'fruit', 1693: 'military', 1694: 'elephant', 1695: 'wrestlers', 1696: 'cards', 1697: 'sumo', 1698: 'camels'} | |
| vocab_size = len(ixtoword) + 1 | |
| def from_model(): | |
| inputs1 = Input(shape=(2048,)) | |
| fe1 = Dropout(0.5)(inputs1) | |
| fe2 = Dense(256, activation='relu')(fe1) | |
| inputs2 = Input(shape=(max_length,)) | |
| embedding_dim = 200 | |
| se1 = Embedding(vocab_size, embedding_dim, mask_zero=True)(inputs2) | |
| se2 = Dropout(0.5)(se1) | |
| se3 = LSTM(256)(se2) | |
| decoder1 = add([fe2, se3]) | |
| decoder2 = Dense(256, activation='relu')(decoder1) | |
| outputs = Dense(vocab_size, activation='softmax')(decoder2) | |
| model = Model(inputs=[inputs1, inputs2], outputs=outputs) | |
| model.load_weights('/app/static//model_30.h5') | |
| return model | |
| def ModeSearch(photo): | |
| in_text = 'startseq' | |
| for i in range(max_length): | |
| sequence = [wordtoix[w] for w in in_text.split() if w in wordtoix] | |
| sequence = pad_sequences([sequence], maxlen=max_length) | |
| model=from_model() | |
| yhat = model.predict([photo, sequence], verbose=0) | |
| yhat = np.argmax(yhat) | |
| word = ixtoword[yhat] | |
| in_text += ' ' + word | |
| if word == 'endseq': | |
| break | |
| final = in_text.split() | |
| final = final[1:-1] | |
| final = ' '.join(final) | |
| return final | |
| def generate_caption(): | |
| # Select a random image from the validation dataset | |
| #random_image_key = random.choice(list(encoding_test.keys())) | |
| # Loading and displaying the random im | |
| #x = plt.imread(os.path.join(images, random_image_key)) | |
| with open("/app/static/encoded_test_images.pkl", "rb") as encoded_pickle: | |
| encoding_test = load(encoded_pickle) | |
| #image = encoding_test['54723805_bcf7af3f16'].reshape((1, 2048)) | |
| random_image_key = random.choice(list(encoding_test.keys())) | |
| print('random_image_key') | |
| print(random_image_key) | |
| print('nameforfile') | |
| print(nameforfile) | |
| image = encoding_test[nameforfile].reshape((1, 2048)) | |
| return ModeSearch(image) | |