Renamed debug module to more fitting 'plotting'

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
2019-09-24 12:26:43 +02:00
parent 48ee5466fb
commit 6b7c3c9172
3 changed files with 9 additions and 7 deletions

View File

@ -174,7 +174,7 @@ def _train_execute_action(args: argparse.Namespace, on_ssd: callable) -> None:
def _ssd_train(args: argparse.Namespace) -> None:
from twomartens.masterthesis import data
from twomartens.masterthesis import debug
from twomartens.masterthesis import plotting
from twomartens.masterthesis import ssd
from twomartens.masterthesis.ssd_keras.eval_utils import coco_utils
@ -205,7 +205,7 @@ def _ssd_train(args: argparse.Namespace) -> None:
predictor_sizes)
_ssd_debug_save_images(args, conf_obj, paths,
debug.save_ssd_train_images, coco_utils.get_coco_category_maps,
plotting.save_ssd_train_images, coco_utils.get_coco_category_maps,
generators.train_debug_generator)
nr_batches_train = _get_nr_batches(generators.train_length, conf_obj.parameters.batch_size)
@ -299,7 +299,7 @@ def _ssd_evaluate_entropy_loop(conf_obj: conf.Config, paths: AttributeDict,
entropy_thresholds: Sequence[float],
labels: Sequence[Sequence], filenames: Sequence[str]) -> None:
from twomartens.masterthesis import debug
from twomartens.masterthesis import plotting
from twomartens.masterthesis import evaluate
from twomartens.masterthesis.ssd_keras.bounding_box_utils import bounding_box_utils
@ -317,7 +317,7 @@ def _ssd_evaluate_entropy_loop(conf_obj: conf.Config, paths: AttributeDict,
if conf_obj.parameters.ssd_use_entropy_threshold else f"{paths.predictions_file}.bin", predictions)
_ssd_evaluate_save_images(filenames, predictions,
coco_utils.get_coco_category_maps, debug.save_ssd_train_images,
coco_utils.get_coco_category_maps, plotting.save_ssd_train_images,
conf_obj, paths)
predictions_per_class = evaluate.prepare_predictions(predictions, conf_obj.parameters.nr_classes)

View File

@ -16,11 +16,13 @@
# limitations under the License.
"""
Handle debug functionality.
Handle plotting functionality.
Functions:
save_ssd_train_images(...):
saves the first batch of SSD train images with overlaid ground truth bounding boxes
draw_bbox_figure(...):
draws a bounding box figure and saves it under the image file name under the output path
"""
import functools
import os

View File

@ -40,7 +40,7 @@ import tensorflow as tf
from attributedict.collections import AttributeDict
from twomartens.masterthesis import config
from twomartens.masterthesis import debug
from twomartens.masterthesis import plotting
from twomartens.masterthesis.ssd_keras.bounding_box_utils import bounding_box_utils
from twomartens.masterthesis.ssd_keras.data_generator import object_detection_2d_misc_utils
from twomartens.masterthesis.ssd_keras.eval_utils import coco_utils
@ -181,7 +181,7 @@ def predict(generator: callable,
"vanilla_step": functools.partial(_predict_vanilla_step, model=model),
"save_images": functools.partial(
_predict_save_images,
save_images=debug.save_ssd_train_images,
save_images=plotting.save_ssd_train_images,
get_coco_cat_maps_func=coco_utils.get_coco_category_maps,
output_path=output_path,
conf_obj=conf_obj