-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgenerate.sh
39 lines (30 loc) · 1.66 KB
/
generate.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
# Path to checkpoint file or a directory containing checkpoint files. Passing
# a directory will only work if there is also a file named 'checkpoint' which
# lists the available checkpoints in the directory. It will not work if you
# point to a directory with just a copy of a model checkpoint: in that case,
# you will need to pass the checkpoint path explicitly.
#CHECKPOINT_PATH="/Users/jinu/tensorflow/models/research/im2txt/Pretrained-Show-and-Tell-model/model.ckpt-2000000"
# Vocabulary file generated by the preprocessing script.
#VOCAB_FILE="/Users/jinu/tensorflow/models/research/im2txt/Pretrained-Show-and-Tell-model/word_counts.txt"
# JPEG image file to caption.
# IMAGE_FILE="/Users/jinu/tensorflow/models/research/im2txt/Pretrained-Show-and-Tell-model/images/test.jpg"
# Build the inference binary.
#bazel build -c opt /Users/jinu/tensorflow/models/research/im2txt/run_inference
# Run inference to generate captions.
#/Users/jinu/tensorflow/models/research/im2txt/bazel-bin/im2txt/run_inference \
# --checkpoint_path=${CHECKPOINT_PATH} \
# --vocab_file=${VOCAB_FILE} \
# --input_files=${IMAGE_FILE}
CHECKPOINT_PATH="./deeplearning/im2txt/Pretrained-Show-and-Tell-model/model.ckpt-2000000"
# Vocabulary file generated by the preprocessing script.
VOCAB_FILE="./deeplearning/im2txt/Pretrained-Show-and-Tell-model/word_counts.txt"
# JPEG image file to caption.
IMAGE_FILE="$1"
# Build the inference binary.
bazel build -c opt ./deeplearning/im2txt/run_inference
# Run inference to generate captions.
./deeplearning/im2txt/bazel-bin/im2txt/run_inference \
--checkpoint_path=${CHECKPOINT_PATH} \
--vocab_file=${VOCAB_FILE} \
--input_files=${IMAGE_FILE}