Remove redundancy. Not updating classify_image.py since it has no effect on runtime performance
MODIFY
tika-parsers/src/main/resources/org/apache/tika/parser/recognition/tf/InceptionRestDockerfile
tika-parsers/src/main/resources/org/apache/tika/parser/recognition/tf/InceptionRestDockerfile
@@ -40,7 +40,7 @@ RUN \
# clean up cache, so we can publish smaller image to hub
RUN apt-get clean
ENV PYTHONPATH="$PYTHONPATH:/models-c15fada28113eca32dc98d6e3bec4755d0d5b4c2/slim"
-#ENV LD_PRELOAD="/usr/lib/libtcmalloc_minimal.so.4"
+ENV LD_PRELOAD="/usr/lib/libtcmalloc_minimal.so.4"
# expose API port, this is the default port
EXPOSE 8764

MODIFY
tika-parsers/src/main/resources/org/apache/tika/parser/recognition/tf/classify_image.py
tika-parsers/src/main/resources/org/apache/tika/parser/recognition/tf/classify_image.py
@@ -169,7 +169,7 @@ def run_inference_on_image(image):
with tf.Session() as sess:
init_fn(sess)
- _, probabilities = sess.run([image, probabilities])
+ probabilities = sess.run(probabilities)
probabilities = probabilities[0, 0:]
sorted_inds = [i[0] for i in sorted(
enumerate(-probabilities), key=lambda x:x[1])]

Remove redundancy. Not updating classify_image.py since it has no effect on runtime performance