├── .gitignore ├── CMakeLists.txt ├── Makefile ├── README.md ├── app.cc └── class_name.h /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | include 3 | data 4 | lib 5 | app 6 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(tensorflow) 3 | include(ExternalProject) 4 | find_package(PythonInterp 2.7) 5 | find_package(PythonLibs 2.7) 6 | get_filename_component(PYTHON_LIBRARIES_DIR ${PYTHON_LIBRARIES} PATH) 7 | 8 | find_package(CUDA) 9 | if(CUDA_FOUND) 10 | set(TF_NEED_CUDA "1") 11 | set(TF_BUILD_CUDA "--config=cuda") 12 | set(CUDNN_INSTALL_PATH ${CMAKE_CURRENT_BINARY_DIR}) 13 | set(CUDNN_VERSION "5") 14 | file(COPY ${CMAKE_SOURCE_DIR}/lib/cudnn.h DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) 15 | file(COPY ${CMAKE_SOURCE_DIR}/lib/libcudnn.so.${CUDNN_VERSION} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) 16 | else() 17 | set(TF_NEED_CUDA "0") 18 | endif() 19 | 20 | ExternalProject_Add(${PROJECT_NAME}-ext 21 | PREFIX ext 22 | GIT_REPOSITORY http://github.com/tensorflow/tensorflow.git 23 | GIT_TAG c0b09babd117fbe9bed9133b0a3f04e9fc2060ec 24 | BUILD_IN_SOURCE 1 25 | INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR} 26 | 27 | CONFIGURE_COMMAND GCC_HOST_COMPILER_PATH=${CMAKE_C_COMPILER} 28 | PYTHON_BIN_PATH=${PYTHON_EXECUTABLE} 29 | PYTHON_LIB_PATH=${PYTHON_LIBRARIES_DIR} 30 | CUDA_TOOLKIT_PATH=${CUDA_TOOLKIT_ROOT_DIR} 31 | CUDNN_INSTALL_PATH=${CUDNN_INSTALL_PATH} 32 | CC_OPT_FLAGS="-march=native" 33 | TF_ENABLE_XLA=0 34 | TF_NEED_JEMALLOC=1 35 | TF_NEED_HDFS=0 36 | TF_NEED_GCP=0 37 | TF_NEED_VERBS=0 38 | TF_NEED_MPI=0 39 | TF_NEED_MKL=1 40 | TF_DOWNLOAD_MKL=1 41 | TF_NEED_OPENCL=0 42 | TF_NEED_CUDA=${TF_NEED_CUDA} 43 | TF_CUDA_CLANG=0 44 | TF_CUDA_VERSION=${CUDA_VERSION} 45 | TF_CUDNN_VERSION=${CUDNN_VERSION} 46 | TF_CUDA_COMPUTE_CAPABILITIES=3.5,5.2 47 | ./configure 48 | 49 | BUILD_COMMAND bazel build -c opt -j 200 --config=opt ${TF_BUILD_CUDA} //tensorflow:libtensorflow_cc.so 50 | //tensorflow/tools/pip_package:build_pip_package 51 | INSTALL_COMMAND cp /bazel-bin/tensorflow/libtensorflow_cc.so ${CMAKE_SOURCE_DIR}/lib/libtensorflow.so 52 | COMMAND /bazel-bin/tensorflow/tools/pip_package/build_pip_package ${CMAKE_SOURCE_DIR}/lib 53 | COMMAND /bin/bash -c "wheel unpack ${CMAKE_SOURCE_DIR}/lib/tensorflow-*.whl" 54 | COMMAND /bin/bash -c "rsync -am /tensorflow-*/tensorflow-*.data/purelib/tensorflow/include ${CMAKE_SOURCE_DIR}" 55 | COMMAND /bin/bash -c "rsync -am --include='*.h' -f 'hide,! */' /bazel-genfiles/tensorflow ${CMAKE_SOURCE_DIR}/include" 56 | COMMAND /bin/bash -c "rsync -am --include='*.h' -f 'hide,! */' /tensorflow ${CMAKE_SOURCE_DIR}/include" 57 | ) 58 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | INCLUDE = -I./include 2 | LIBOPTS = -L./lib 3 | LDFLAGS := -ltensorflow 4 | CFLAGS = -O3 -fpic -Wall -std=c++11 5 | CC = g++ 6 | 7 | .PHONY : all 8 | all : run 9 | 10 | dependency : 11 | echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list 12 | curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add - 13 | sudo apt-get update && sudo apt-get -y install bazel python-pip python-numpy swig python-dev python-wheel python-wheel-common 14 | 15 | build : 16 | rm -rf build && mkdir -p build 17 | cd build && cmake .. && make 18 | 19 | data : 20 | mkdir -p data 21 | cd data && wget https://storage.googleapis.com/download.tensorflow.org/models/inception_dec_2015.zip 22 | cd data && wget https://raw.githubusercontent.com/tensorflow/tensorflow/master/tensorflow/examples/label_image/data/grace_hopper.jpg 23 | cd data && unzip inception_dec_2015.zip 24 | rm -f data/inception_dec_2015.zip 25 | 26 | app : build data lib/libtensorflow.so 27 | $(CC) app.cc $(CFLAGS) $(INCLUDE) $(LIBOPTS) -o $@ $(LDFLAGS) 28 | 29 | run : app 30 | LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:./lib && CUDA_VISIBLE_DEVICES=0 ./app ./data/grace_hopper.jpg 31 | 32 | clean : 33 | rm -f *.o app 34 | 35 | reset : clean 36 | rm -rf build include data lib/libtensorflow.so lib/tensorflow-* 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tensorflow C++ API example 2 | 3 | The repository provides a basic image classification example using Tensorflow shared library (.so). 4 | Tested on the Ubuntu 16.04 machine. 5 | 6 | 7 | ## Dependencies 8 | 9 | Download `cudnn` library under the `lib` directory for CUDA. 10 | 11 | ```bash 12 | lib/cudnn.h 13 | lib/libcudnn.so.5 # with major version included in filename 14 | ``` 15 | 16 | and `make dependency` to install dependent packages via apt-get. 17 | Update [CMakeLists.txt](CMakeLists.txt) according to your configuration if needed. 18 | 19 | 20 | ## Build and run 21 | 22 | Calling the Makefile target will build tensorflow library, 23 | download a pretrained model, and run the app. 24 | 25 | ```bash 26 | make 27 | ``` 28 | 29 | If you need python interface, try `pip install lib/tensorflow*.whl`. 30 | -------------------------------------------------------------------------------- /app.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "class_name.h" 6 | #include "tensorflow/cc/ops/const_op.h" 7 | #include "tensorflow/cc/ops/image_ops.h" 8 | #include "tensorflow/cc/ops/standard_ops.h" 9 | #include "tensorflow/core/framework/graph.pb.h" 10 | #include "tensorflow/core/framework/tensor.h" 11 | #include "tensorflow/core/graph/default_device.h" 12 | #include "tensorflow/core/graph/graph_def_builder.h" 13 | #include "tensorflow/core/lib/core/errors.h" 14 | #include "tensorflow/core/lib/core/stringpiece.h" 15 | #include "tensorflow/core/lib/core/threadpool.h" 16 | #include "tensorflow/core/lib/io/path.h" 17 | #include "tensorflow/core/lib/strings/stringprintf.h" 18 | #include "tensorflow/core/platform/init_main.h" 19 | #include "tensorflow/core/platform/logging.h" 20 | #include "tensorflow/core/platform/types.h" 21 | #include "tensorflow/core/public/session.h" 22 | #include "tensorflow/core/util/command_line_flags.h" 23 | 24 | using tensorflow::Flag; 25 | using tensorflow::Tensor; 26 | using tensorflow::Status; 27 | using tensorflow::string; 28 | using tensorflow::int32; 29 | 30 | // Given an image file name, read in the data, try to decode it as an image, 31 | // resize it to the requested size, and then scale the values as desired. 32 | Status ReadTensorFromImageFile(string file_name, const int input_height, 33 | const int input_width, const float input_mean, 34 | const float input_std, 35 | std::vector* out_tensors) { 36 | auto root = tensorflow::Scope::NewRootScope(); 37 | using namespace ::tensorflow::ops; // NOLINT(build/namespaces) 38 | 39 | string input_name = "file_reader"; 40 | string output_name = "normalized"; 41 | auto file_reader = tensorflow::ops::ReadFile(root.WithOpName(input_name), 42 | file_name); 43 | // Now try to figure out what kind of file it is and decode it. 44 | const int wanted_channels = 3; 45 | tensorflow::Output image_reader; 46 | if (tensorflow::StringPiece(file_name).ends_with(".png")) { 47 | image_reader = DecodePng(root.WithOpName("png_reader"), file_reader, 48 | DecodePng::Channels(wanted_channels)); 49 | } else if (tensorflow::StringPiece(file_name).ends_with(".gif")) { 50 | image_reader = DecodeGif(root.WithOpName("gif_reader"), file_reader); 51 | } else { 52 | // Assume if it's neither a PNG nor a GIF then it must be a JPEG. 53 | image_reader = DecodeJpeg(root.WithOpName("jpeg_reader"), file_reader, 54 | DecodeJpeg::Channels(wanted_channels)); 55 | } 56 | // Now cast the image data to float so we can do normal math on it. 57 | auto float_caster = 58 | Cast(root.WithOpName("float_caster"), image_reader, tensorflow::DT_FLOAT); 59 | // The convention for image ops in TensorFlow is that all images are expected 60 | // to be in batches, so that they're four-dimensional arrays with indices of 61 | // [batch, height, width, channel]. Because we only have a single image, we 62 | // have to add a batch dimension of 1 to the start with ExpandDims(). 63 | auto dims_expander = ExpandDims(root, float_caster, 0); 64 | // Bilinearly resize the image to fit the required dimensions. 65 | auto resized = ResizeBilinear( 66 | root, dims_expander, 67 | Const(root.WithOpName("size"), {input_height, input_width})); 68 | // Subtract the mean and divide by the scale. 69 | Div(root.WithOpName(output_name), Sub(root, resized, {input_mean}), 70 | {input_std}); 71 | 72 | // This runs the GraphDef network definition that we've just constructed, and 73 | // returns the results in the output tensor. 74 | tensorflow::GraphDef graph; 75 | TF_RETURN_IF_ERROR(root.ToGraphDef(&graph)); 76 | 77 | std::unique_ptr session( 78 | tensorflow::NewSession(tensorflow::SessionOptions())); 79 | TF_RETURN_IF_ERROR(session->Create(graph)); 80 | TF_RETURN_IF_ERROR(session->Run({}, {output_name}, {}, out_tensors)); 81 | return Status::OK(); 82 | } 83 | 84 | int main(int argc, char* argv[]) { 85 | 86 | string graph_path = "./data/tensorflow_inception_graph.pb"; 87 | tensorflow::port::InitMain(argv[0], &argc, &argv); 88 | 89 | tensorflow::GraphDef graph_def; 90 | if (!ReadBinaryProto(tensorflow::Env::Default(), graph_path, &graph_def).ok()) { 91 | LOG(ERROR) << "Read proto"; 92 | return -1; 93 | } 94 | 95 | std::unique_ptr session; 96 | tensorflow::SessionOptions sess_opt; 97 | sess_opt.config.mutable_gpu_options()->set_allow_growth(true); 98 | (&session)->reset(tensorflow::NewSession(sess_opt)); 99 | if (!session->Create(graph_def).ok()) { 100 | LOG(ERROR) << "Create graph"; 101 | return -1; 102 | } 103 | 104 | const int batch_size = argc - 1; 105 | if (batch_size != 1) { 106 | LOG(ERROR) << "Batch mode for the pretrained inception-v3 is unsupported"; 107 | LOG(ERROR) << " - https://github.com/tensorflow/tensorflow/issues/554"; 108 | return -1; 109 | } 110 | 111 | int32 input_dim = 299; 112 | int32 input_mean = 128; 113 | int32 input_std = 128; 114 | std::vector inputs; 115 | std::string image_path(argv[1]); 116 | if (!ReadTensorFromImageFile(image_path, input_dim, input_dim, input_mean, 117 | input_std, &inputs).ok()) { 118 | LOG(ERROR) << "Load image"; 119 | return -1; 120 | } 121 | 122 | std::vector outputs; 123 | string input_layer = "Mul"; 124 | string output_layer = "softmax"; 125 | if (!session->Run({{input_layer, inputs[0]}}, 126 | {output_layer}, {}, &outputs).ok()) { 127 | LOG(ERROR) << "Running model failed"; 128 | return -1; 129 | } 130 | 131 | Eigen::Map pred(outputs[0].flat().data(), 132 | outputs[0].NumElements()); 133 | int maxIndex; float maxValue = pred.maxCoeff(&maxIndex); 134 | LOG(INFO) << "P( " << class_name[maxIndex] << " | image ) = " << maxValue; 135 | 136 | return 0; 137 | } 138 | -------------------------------------------------------------------------------- /class_name.h: -------------------------------------------------------------------------------- 1 | const std::string class_name[1001] = { 2 | "dummy", 3 | "kit fox", 4 | "English setter", 5 | "Siberian husky", 6 | "Australian terrier", 7 | "English springer", 8 | "grey whale", 9 | "lesser panda", 10 | "Egyptian cat", 11 | "ibex", 12 | "Persian cat", 13 | "cougar", 14 | "gazelle", 15 | "porcupine", 16 | "sea lion", 17 | "malamute", 18 | "badger", 19 | "Great Dane", 20 | "Walker hound", 21 | "Welsh springer spaniel", 22 | "whippet", 23 | "Scottish deerhound", 24 | "killer whale", 25 | "mink", 26 | "African elephant", 27 | "Weimaraner", 28 | "soft-coated wheaten terrier", 29 | "Dandie Dinmont", 30 | "red wolf", 31 | "Old English sheepdog", 32 | "jaguar", 33 | "otterhound", 34 | "bloodhound", 35 | "Airedale", 36 | "hyena", 37 | "meerkat", 38 | "giant schnauzer", 39 | "titi", 40 | "three-toed sloth", 41 | "sorrel", 42 | "black-footed ferret", 43 | "dalmatian", 44 | "black-and-tan coonhound", 45 | "papillon", 46 | "skunk", 47 | "Staffordshire bullterrier", 48 | "Mexican hairless", 49 | "Bouvier des Flandres", 50 | "weasel", 51 | "miniature poodle", 52 | "Cardigan", 53 | "malinois", 54 | "bighorn", 55 | "fox squirrel", 56 | "colobus", 57 | "tiger cat", 58 | "Lhasa", 59 | "impala", 60 | "coyote", 61 | "Yorkshire terrier", 62 | "Newfoundland", 63 | "brown bear", 64 | "red fox", 65 | "Norwegian elkhound", 66 | "Rottweiler", 67 | "hartebeest", 68 | "Saluki", 69 | "grey fox", 70 | "schipperke", 71 | "Pekinese", 72 | "Brabancon griffon", 73 | "West Highland white terrier", 74 | "Sealyham terrier", 75 | "guenon", 76 | "mongoose", 77 | "indri", 78 | "tiger", 79 | "Irish wolfhound", 80 | "wild boar", 81 | "EntleBucher", 82 | "zebra", 83 | "ram", 84 | "French bulldog", 85 | "orangutan", 86 | "basenji", 87 | "leopard", 88 | "Bernese mountain dog", 89 | "Maltese dog", 90 | "Norfolk terrier", 91 | "toy terrier", 92 | "vizsla", 93 | "cairn", 94 | "squirrel monkey", 95 | "groenendael", 96 | "clumber", 97 | "Siamese cat", 98 | "chimpanzee", 99 | "komondor", 100 | "Afghan hound", 101 | "Japanese spaniel", 102 | "proboscis monkey", 103 | "guinea pig", 104 | "white wolf", 105 | "ice bear", 106 | "gorilla", 107 | "borzoi", 108 | "toy poodle", 109 | "Kerry blue terrier", 110 | "ox", 111 | "Scotch terrier", 112 | "Tibetan mastiff", 113 | "spider monkey", 114 | "Doberman", 115 | "Boston bull", 116 | "Greater Swiss Mountain dog", 117 | "Appenzeller", 118 | "Shih-Tzu", 119 | "Irish water spaniel", 120 | "Pomeranian", 121 | "Bedlington terrier", 122 | "warthog", 123 | "Arabian camel", 124 | "siamang", 125 | "miniature schnauzer", 126 | "collie", 127 | "golden retriever", 128 | "Irish terrier", 129 | "affenpinscher", 130 | "Border collie", 131 | "hare", 132 | "boxer", 133 | "silky terrier", 134 | "beagle", 135 | "Leonberg", 136 | "German short-haired pointer", 137 | "patas", 138 | "dhole", 139 | "baboon", 140 | "macaque", 141 | "Chesapeake Bay retriever", 142 | "bull mastiff", 143 | "kuvasz", 144 | "capuchin", 145 | "pug", 146 | "curly-coated retriever", 147 | "Norwich terrier", 148 | "flat-coated retriever", 149 | "hog", 150 | "keeshond", 151 | "Eskimo dog", 152 | "Brittany spaniel", 153 | "standard poodle", 154 | "Lakeland terrier", 155 | "snow leopard", 156 | "Gordon setter", 157 | "dingo", 158 | "standard schnauzer", 159 | "hamster", 160 | "Tibetan terrier", 161 | "Arctic fox", 162 | "wire-haired fox terrier", 163 | "basset", 164 | "water buffalo", 165 | "American black bear", 166 | "Angora", 167 | "bison", 168 | "howler monkey", 169 | "hippopotamus", 170 | "chow", 171 | "giant panda", 172 | "American Staffordshire terrier", 173 | "Shetland sheepdog", 174 | "Great Pyrenees", 175 | "Chihuahua", 176 | "tabby", 177 | "marmoset", 178 | "Labrador retriever", 179 | "Saint Bernard", 180 | "armadillo", 181 | "Samoyed", 182 | "bluetick", 183 | "redbone", 184 | "polecat", 185 | "marmot", 186 | "kelpie", 187 | "gibbon", 188 | "llama", 189 | "miniature pinscher", 190 | "wood rabbit", 191 | "Italian greyhound", 192 | "lion", 193 | "cocker spaniel", 194 | "Irish setter", 195 | "dugong", 196 | "Indian elephant", 197 | "beaver", 198 | "Sussex spaniel", 199 | "Pembroke", 200 | "Blenheim spaniel", 201 | "Madagascar cat", 202 | "Rhodesian ridgeback", 203 | "lynx", 204 | "African hunting dog", 205 | "langur", 206 | "Ibizan hound", 207 | "timber wolf", 208 | "cheetah", 209 | "English foxhound", 210 | "briard", 211 | "sloth bear", 212 | "Border terrier", 213 | "German shepherd", 214 | "otter", 215 | "koala", 216 | "tusker", 217 | "echidna", 218 | "wallaby", 219 | "platypus", 220 | "wombat", 221 | "revolver", 222 | "umbrella", 223 | "schooner", 224 | "soccer ball", 225 | "accordion", 226 | "ant", 227 | "starfish", 228 | "chambered nautilus", 229 | "grand piano", 230 | "laptop", 231 | "strawberry", 232 | "airliner", 233 | "warplane", 234 | "airship", 235 | "balloon", 236 | "space shuttle", 237 | "fireboat", 238 | "gondola", 239 | "speedboat", 240 | "lifeboat", 241 | "canoe", 242 | "yawl", 243 | "catamaran", 244 | "trimaran", 245 | "container ship", 246 | "liner", 247 | "pirate", 248 | "aircraft carrier", 249 | "submarine", 250 | "wreck", 251 | "half track", 252 | "tank", 253 | "missile", 254 | "bobsled", 255 | "dogsled", 256 | "bicycle-built-for-two", 257 | "mountain bike", 258 | "freight car", 259 | "passenger car", 260 | "barrow", 261 | "shopping cart", 262 | "motor scooter", 263 | "forklift", 264 | "electric locomotive", 265 | "steam locomotive", 266 | "amphibian", 267 | "ambulance", 268 | "beach wagon", 269 | "cab", 270 | "convertible", 271 | "jeep", 272 | "limousine", 273 | "minivan", 274 | "Model T", 275 | "racer", 276 | "sports car", 277 | "go-kart", 278 | "golfcart", 279 | "moped", 280 | "snowplow", 281 | "fire engine", 282 | "garbage truck", 283 | "pickup", 284 | "tow truck", 285 | "trailer truck", 286 | "moving van", 287 | "police van", 288 | "recreational vehicle", 289 | "streetcar", 290 | "snowmobile", 291 | "tractor", 292 | "mobile home", 293 | "tricycle", 294 | "unicycle", 295 | "horse cart", 296 | "jinrikisha", 297 | "oxcart", 298 | "bassinet", 299 | "cradle", 300 | "crib", 301 | "four-poster", 302 | "bookcase", 303 | "china cabinet", 304 | "medicine chest", 305 | "chiffonier", 306 | "table lamp", 307 | "file", 308 | "park bench", 309 | "barber chair", 310 | "throne", 311 | "folding chair", 312 | "rocking chair", 313 | "studio couch", 314 | "toilet seat", 315 | "desk", 316 | "pool table", 317 | "dining table", 318 | "entertainment center", 319 | "wardrobe", 320 | "Granny Smith", 321 | "orange", 322 | "lemon", 323 | "fig", 324 | "pineapple", 325 | "banana", 326 | "jackfruit", 327 | "custard apple", 328 | "pomegranate", 329 | "acorn", 330 | "hip", 331 | "ear", 332 | "rapeseed", 333 | "corn", 334 | "buckeye", 335 | "organ", 336 | "upright", 337 | "chime", 338 | "drum", 339 | "gong", 340 | "maraca", 341 | "marimba", 342 | "steel drum", 343 | "banjo", 344 | "cello", 345 | "violin", 346 | "harp", 347 | "acoustic guitar", 348 | "electric guitar", 349 | "cornet", 350 | "French horn", 351 | "trombone", 352 | "harmonica", 353 | "ocarina", 354 | "panpipe", 355 | "bassoon", 356 | "oboe", 357 | "sax", 358 | "flute", 359 | "daisy", 360 | "yellow lady's slipper", 361 | "cliff", 362 | "valley", 363 | "alp", 364 | "volcano", 365 | "promontory", 366 | "sandbar", 367 | "coral reef", 368 | "lakeside", 369 | "seashore", 370 | "geyser", 371 | "hatchet", 372 | "cleaver", 373 | "letter opener", 374 | "plane", 375 | "power drill", 376 | "lawn mower", 377 | "hammer", 378 | "corkscrew", 379 | "can opener", 380 | "plunger", 381 | "screwdriver", 382 | "shovel", 383 | "plow", 384 | "chain saw", 385 | "cock", 386 | "hen", 387 | "ostrich", 388 | "brambling", 389 | "goldfinch", 390 | "house finch", 391 | "junco", 392 | "indigo bunting", 393 | "robin", 394 | "bulbul", 395 | "jay", 396 | "magpie", 397 | "chickadee", 398 | "water ouzel", 399 | "kite", 400 | "bald eagle", 401 | "vulture", 402 | "great grey owl", 403 | "black grouse", 404 | "ptarmigan", 405 | "ruffed grouse", 406 | "prairie chicken", 407 | "peacock", 408 | "quail", 409 | "partridge", 410 | "African grey", 411 | "macaw", 412 | "sulphur-crested cockatoo", 413 | "lorikeet", 414 | "coucal", 415 | "bee eater", 416 | "hornbill", 417 | "hummingbird", 418 | "jacamar", 419 | "toucan", 420 | "drake", 421 | "red-breasted merganser", 422 | "goose", 423 | "black swan", 424 | "white stork", 425 | "black stork", 426 | "spoonbill", 427 | "flamingo", 428 | "American egret", 429 | "little blue heron", 430 | "bittern", 431 | "crane", 432 | "limpkin", 433 | "American coot", 434 | "bustard", 435 | "ruddy turnstone", 436 | "red-backed sandpiper", 437 | "redshank", 438 | "dowitcher", 439 | "oystercatcher", 440 | "European gallinule", 441 | "pelican", 442 | "king penguin", 443 | "albatross", 444 | "great white shark", 445 | "tiger shark", 446 | "hammerhead", 447 | "electric ray", 448 | "stingray", 449 | "barracouta", 450 | "coho", 451 | "tench", 452 | "goldfish", 453 | "eel", 454 | "rock beauty", 455 | "anemone fish", 456 | "lionfish", 457 | "puffer", 458 | "sturgeon", 459 | "gar", 460 | "loggerhead", 461 | "leatherback turtle", 462 | "mud turtle", 463 | "terrapin", 464 | "box turtle", 465 | "banded gecko", 466 | "common iguana", 467 | "American chameleon", 468 | "whiptail", 469 | "agama", 470 | "frilled lizard", 471 | "alligator lizard", 472 | "Gila monster", 473 | "green lizard", 474 | "African chameleon", 475 | "Komodo dragon", 476 | "triceratops", 477 | "African crocodile", 478 | "American alligator", 479 | "thunder snake", 480 | "ringneck snake", 481 | "hognose snake", 482 | "green snake", 483 | "king snake", 484 | "garter snake", 485 | "water snake", 486 | "vine snake", 487 | "night snake", 488 | "boa constrictor", 489 | "rock python", 490 | "Indian cobra", 491 | "green mamba", 492 | "sea snake", 493 | "horned viper", 494 | "diamondback", 495 | "sidewinder", 496 | "European fire salamander", 497 | "common newt", 498 | "eft", 499 | "spotted salamander", 500 | "axolotl", 501 | "bullfrog", 502 | "tree frog", 503 | "tailed frog", 504 | "whistle", 505 | "wing", 506 | "paintbrush", 507 | "hand blower", 508 | "oxygen mask", 509 | "snorkel", 510 | "loudspeaker", 511 | "microphone", 512 | "screen", 513 | "mouse", 514 | "electric fan", 515 | "oil filter", 516 | "strainer", 517 | "space heater", 518 | "stove", 519 | "guillotine", 520 | "barometer", 521 | "rule", 522 | "odometer", 523 | "scale", 524 | "analog clock", 525 | "digital clock", 526 | "wall clock", 527 | "hourglass", 528 | "sundial", 529 | "parking meter", 530 | "stopwatch", 531 | "digital watch", 532 | "stethoscope", 533 | "syringe", 534 | "magnetic compass", 535 | "binoculars", 536 | "projector", 537 | "sunglasses", 538 | "loupe", 539 | "radio telescope", 540 | "bow", 541 | "cannon [ground]", 542 | "assault rifle", 543 | "rifle", 544 | "projectile", 545 | "computer keyboard", 546 | "typewriter keyboard", 547 | "crane", 548 | "lighter", 549 | "abacus", 550 | "cash machine", 551 | "slide rule", 552 | "desktop computer", 553 | "hand-held computer", 554 | "notebook", 555 | "web site", 556 | "harvester", 557 | "thresher", 558 | "printer", 559 | "slot", 560 | "vending machine", 561 | "sewing machine", 562 | "joystick", 563 | "switch", 564 | "hook", 565 | "car wheel", 566 | "paddlewheel", 567 | "pinwheel", 568 | "potter's wheel", 569 | "gas pump", 570 | "carousel", 571 | "swing", 572 | "reel", 573 | "radiator", 574 | "puck", 575 | "hard disc", 576 | "sunglass", 577 | "pick", 578 | "car mirror", 579 | "solar dish", 580 | "remote control", 581 | "disk brake", 582 | "buckle", 583 | "hair slide", 584 | "knot", 585 | "combination lock", 586 | "padlock", 587 | "nail", 588 | "safety pin", 589 | "screw", 590 | "muzzle", 591 | "seat belt", 592 | "ski", 593 | "candle", 594 | "jack-o'-lantern", 595 | "spotlight", 596 | "torch", 597 | "neck brace", 598 | "pier", 599 | "tripod", 600 | "maypole", 601 | "mousetrap", 602 | "spider web", 603 | "trilobite", 604 | "harvestman", 605 | "scorpion", 606 | "black and gold garden spider", 607 | "barn spider", 608 | "garden spider", 609 | "black widow", 610 | "tarantula", 611 | "wolf spider", 612 | "tick", 613 | "centipede", 614 | "isopod", 615 | "Dungeness crab", 616 | "rock crab", 617 | "fiddler crab", 618 | "king crab", 619 | "American lobster", 620 | "spiny lobster", 621 | "crayfish", 622 | "hermit crab", 623 | "tiger beetle", 624 | "ladybug", 625 | "ground beetle", 626 | "long-horned beetle", 627 | "leaf beetle", 628 | "dung beetle", 629 | "rhinoceros beetle", 630 | "weevil", 631 | "fly", 632 | "bee", 633 | "grasshopper", 634 | "cricket", 635 | "walking stick", 636 | "cockroach", 637 | "mantis", 638 | "cicada", 639 | "leafhopper", 640 | "lacewing", 641 | "dragonfly", 642 | "damselfly", 643 | "admiral", 644 | "ringlet", 645 | "monarch", 646 | "cabbage butterfly", 647 | "sulphur butterfly", 648 | "lycaenid", 649 | "jellyfish", 650 | "sea anemone", 651 | "brain coral", 652 | "flatworm", 653 | "nematode", 654 | "conch", 655 | "snail", 656 | "slug", 657 | "sea slug", 658 | "chiton", 659 | "sea urchin", 660 | "sea cucumber", 661 | "iron", 662 | "espresso maker", 663 | "microwave", 664 | "Dutch oven", 665 | "rotisserie", 666 | "toaster", 667 | "waffle iron", 668 | "vacuum", 669 | "dishwasher", 670 | "refrigerator", 671 | "washer", 672 | "Crock Pot", 673 | "frying pan", 674 | "wok", 675 | "caldron", 676 | "coffeepot", 677 | "teapot", 678 | "spatula", 679 | "altar", 680 | "triumphal arch", 681 | "patio", 682 | "steel arch bridge", 683 | "suspension bridge", 684 | "viaduct", 685 | "barn", 686 | "greenhouse", 687 | "palace", 688 | "monastery", 689 | "library", 690 | "apiary", 691 | "boathouse", 692 | "church", 693 | "mosque", 694 | "stupa", 695 | "planetarium", 696 | "restaurant", 697 | "cinema", 698 | "home theater", 699 | "lumbermill", 700 | "coil", 701 | "obelisk", 702 | "totem pole", 703 | "castle", 704 | "prison", 705 | "grocery store", 706 | "bakery", 707 | "barbershop", 708 | "bookshop", 709 | "butcher shop", 710 | "confectionery", 711 | "shoe shop", 712 | "tobacco shop", 713 | "toyshop", 714 | "fountain", 715 | "cliff dwelling", 716 | "yurt", 717 | "dock", 718 | "brass", 719 | "megalith", 720 | "bannister", 721 | "breakwater", 722 | "dam", 723 | "chainlink fence", 724 | "picket fence", 725 | "worm fence", 726 | "stone wall", 727 | "grille", 728 | "sliding door", 729 | "turnstile", 730 | "mountain tent", 731 | "scoreboard", 732 | "honeycomb", 733 | "plate rack", 734 | "pedestal", 735 | "beacon", 736 | "mashed potato", 737 | "bell pepper", 738 | "head cabbage", 739 | "broccoli", 740 | "cauliflower", 741 | "zucchini", 742 | "spaghetti squash", 743 | "acorn squash", 744 | "butternut squash", 745 | "cucumber", 746 | "artichoke", 747 | "cardoon", 748 | "mushroom", 749 | "shower curtain", 750 | "jean", 751 | "carton", 752 | "handkerchief", 753 | "sandal", 754 | "ashcan", 755 | "safe", 756 | "plate", 757 | "necklace", 758 | "croquet ball", 759 | "fur coat", 760 | "thimble", 761 | "pajama", 762 | "running shoe", 763 | "cocktail shaker", 764 | "chest", 765 | "manhole cover", 766 | "modem", 767 | "tub", 768 | "tray", 769 | "balance beam", 770 | "bagel", 771 | "prayer rug", 772 | "kimono", 773 | "hot pot", 774 | "whiskey jug", 775 | "knee pad", 776 | "book jacket", 777 | "spindle", 778 | "ski mask", 779 | "beer bottle", 780 | "crash helmet", 781 | "bottlecap", 782 | "tile roof", 783 | "mask", 784 | "maillot", 785 | "Petri dish", 786 | "football helmet", 787 | "bathing cap", 788 | "teddy bear", 789 | "holster", 790 | "pop bottle", 791 | "photocopier", 792 | "vestment", 793 | "crossword puzzle", 794 | "golf ball", 795 | "trifle", 796 | "suit", 797 | "water tower", 798 | "feather boa", 799 | "cloak", 800 | "red wine", 801 | "drumstick", 802 | "shield", 803 | "Christmas stocking", 804 | "hoopskirt", 805 | "menu", 806 | "stage", 807 | "bonnet", 808 | "meat loaf", 809 | "baseball", 810 | "face powder", 811 | "scabbard", 812 | "sunscreen", 813 | "beer glass", 814 | "hen-of-the-woods", 815 | "guacamole", 816 | "lampshade", 817 | "wool", 818 | "hay", 819 | "bow tie", 820 | "mailbag", 821 | "water jug", 822 | "bucket", 823 | "dishrag", 824 | "soup bowl", 825 | "eggnog", 826 | "mortar", 827 | "trench coat", 828 | "paddle", 829 | "chain", 830 | "swab", 831 | "mixing bowl", 832 | "potpie", 833 | "wine bottle", 834 | "shoji", 835 | "bulletproof vest", 836 | "drilling platform", 837 | "binder", 838 | "cardigan", 839 | "sweatshirt", 840 | "pot", 841 | "birdhouse", 842 | "hamper", 843 | "ping-pong ball", 844 | "pencil box", 845 | "pay-phone", 846 | "consomme", 847 | "apron", 848 | "punching bag", 849 | "backpack", 850 | "groom", 851 | "bearskin", 852 | "pencil sharpener", 853 | "broom", 854 | "mosquito net", 855 | "abaya", 856 | "mortarboard", 857 | "poncho", 858 | "crutch", 859 | "Polaroid camera", 860 | "space bar", 861 | "cup", 862 | "racket", 863 | "traffic light", 864 | "quill", 865 | "radio", 866 | "dough", 867 | "cuirass", 868 | "military uniform", 869 | "lipstick", 870 | "shower cap", 871 | "monitor", 872 | "oscilloscope", 873 | "mitten", 874 | "brassiere", 875 | "French loaf", 876 | "vase", 877 | "milk can", 878 | "rugby ball", 879 | "paper towel", 880 | "earthstar", 881 | "envelope", 882 | "miniskirt", 883 | "cowboy hat", 884 | "trolleybus", 885 | "perfume", 886 | "bathtub", 887 | "hotdog", 888 | "coral fungus", 889 | "bullet train", 890 | "pillow", 891 | "toilet tissue", 892 | "cassette", 893 | "carpenter's kit", 894 | "ladle", 895 | "stinkhorn", 896 | "lotion", 897 | "hair spray", 898 | "academic gown", 899 | "dome", 900 | "crate", 901 | "wig", 902 | "burrito", 903 | "pill bottle", 904 | "chain mail", 905 | "theater curtain", 906 | "window shade", 907 | "barrel", 908 | "washbasin", 909 | "ballpoint", 910 | "basketball", 911 | "bath towel", 912 | "cowboy boot", 913 | "gown", 914 | "window screen", 915 | "agaric", 916 | "cellular telephone", 917 | "nipple", 918 | "barbell", 919 | "mailbox", 920 | "lab coat", 921 | "fire screen", 922 | "minibus", 923 | "packet", 924 | "maze", 925 | "pole", 926 | "horizontal bar", 927 | "sombrero", 928 | "pickelhaube", 929 | "rain barrel", 930 | "wallet", 931 | "cassette player", 932 | "comic book", 933 | "piggy bank", 934 | "street sign", 935 | "bell cote", 936 | "fountain pen", 937 | "Windsor tie", 938 | "volleyball", 939 | "overskirt", 940 | "sarong", 941 | "purse", 942 | "bolo tie", 943 | "bib", 944 | "parachute", 945 | "sleeping bag", 946 | "television", 947 | "swimming trunks", 948 | "measuring cup", 949 | "espresso", 950 | "pizza", 951 | "breastplate", 952 | "shopping basket", 953 | "wooden spoon", 954 | "saltshaker", 955 | "chocolate sauce", 956 | "ballplayer", 957 | "goblet", 958 | "gyromitra", 959 | "stretcher", 960 | "water bottle", 961 | "dial telephone", 962 | "soap dispenser", 963 | "jersey", 964 | "school bus", 965 | "jigsaw puzzle", 966 | "plastic bag", 967 | "reflex camera", 968 | "diaper", 969 | "Band Aid", 970 | "ice lolly", 971 | "velvet", 972 | "tennis ball", 973 | "gasmask", 974 | "doormat", 975 | "Loafer", 976 | "ice cream", 977 | "pretzel", 978 | "quilt", 979 | "maillot", 980 | "tape player", 981 | "clog", 982 | "iPod", 983 | "bolete", 984 | "scuba diver", 985 | "pitcher", 986 | "matchstick", 987 | "bikini", 988 | "sock", 989 | "CD player", 990 | "lens cap", 991 | "thatch", 992 | "vault", 993 | "beaker", 994 | "bubble", 995 | "cheeseburger", 996 | "parallel bars", 997 | "flagpole", 998 | "coffee mug", 999 | "rubber eraser", 1000 | "stole", 1001 | "carbonara", 1002 | "dumbbell", 1003 | }; 1004 | --------------------------------------------------------------------------------