im2txtを使って同じフォルダに保存されている数千のjpegイメージのキャプションを生成できるかどうかを知りたいだけです。私はちょうどそのようなものと一緒に行くべきですか?キャプションを生成し、結果を.txtファイルに書き出します。im2txtで大きなjpegセットをキャプションする
# Directory containing model checkpoints.
CHECKPOINT_DIR="${HOME}/im2txt/model/train"
# Vocabulary file generated by the preprocessing script.
VOCAB_FILE="${HOME}/im2txt/data/mscoco/word_counts.txt"
# JPEG image file to caption.
IMAGE_FILE="${HOME}/im2txt/data/lotofimages/
# Build the inference binary.
bazel build -c opt im2txt/run_inference
# Ignore GPU devices (only necessary if your GPU is currently memory
# constrained, for example, by running the training script).
export CUDA_VISIBLE_DEVICES=""
# Run inference to generate captions.
bazel-bin/im2txt/run_inference >> 1.txt \
--checkpoint_path=${CHECKPOINT_DIR} \
--vocab_file=${VOCAB_FILE} \
--input_files=${IMAGE_FILE}
ありがとうございます!
私はそれを忘れて使用する。// githubのを。 com/tensorflow/models/tree/master/im2txt –