Merge pull request #73 from ANaaim/Optimise_MarkerAugmentation
Clear keras session to avoid time increase when doing batch processing
This commit is contained in:
commit
62534a9229
@ -31,6 +31,7 @@ from Pose2Sim.MarkerAugmenter.utils import TRC2numpy
|
|||||||
import json
|
import json
|
||||||
import glob
|
import glob
|
||||||
import logging
|
import logging
|
||||||
|
import keras
|
||||||
|
|
||||||
|
|
||||||
## AUTHORSHIP INFORMATION
|
## AUTHORSHIP INFORMATION
|
||||||
@ -183,6 +184,7 @@ def augmentTRC(config_dict):
|
|||||||
model = tf.keras.models.model_from_json(pretrainedModel_json)
|
model = tf.keras.models.model_from_json(pretrainedModel_json)
|
||||||
model.load_weights(os.path.join(augmenterModelDir, "weights.h5"))
|
model.load_weights(os.path.join(augmenterModelDir, "weights.h5"))
|
||||||
outputs = model.predict(inputs)
|
outputs = model.predict(inputs)
|
||||||
|
keras.backend.clear_session()
|
||||||
|
|
||||||
# %% Post-process outputs.
|
# %% Post-process outputs.
|
||||||
# Step 1: Reshape if necessary (eg, LSTM)
|
# Step 1: Reshape if necessary (eg, LSTM)
|
||||||
|
Loading…
Reference in New Issue
Block a user