new_nbv_rec/app_inference.py
2025-05-19 16:32:04 +08:00

104 lines
4.0 KiB
Python

from PytorchBoot.application import PytorchBootApplication
from runners.global_points_inferencer import GlobalPointsInferencer
from runners.global_and_local_points_inferencer import GlobalAndLocalPointsInferencer
from runners.local_points_inferencer import LocalPointsInferencer
from runners.inference_server import InferencerServer
from runners.evaluate_uncertainty_guide import EvaluateUncertaintyGuide
from runners.evaluate_pbnbv import EvaluatePBNBV
@PytorchBootApplication("global_points_inference")
class GlobalPointsInferenceApp:
@staticmethod
def start():
'''
call default or your custom runners here, code will be executed
automatically when type "pytorch-boot run" or "ptb run" in terminal
example:
Trainer("path_to_your_train_config").run()
Evaluator("path_to_your_eval_config").run()
'''
GlobalPointsInferencer("./configs/local/global_only_inference_config.yaml").run()
@PytorchBootApplication("global_and_local_points_inference")
class GlobalAndLocalPointsInferenceApp:
@staticmethod
def start():
'''
call default or your custom runners here, code will be executed
automatically when type "pytorch-boot run" or "ptb run" in terminal
example:
Trainer("path_to_your_train_config").run()
Evaluator("path_to_your_eval_config").run()
'''
GlobalAndLocalPointsInferencer("./configs/local/global_pts_and_local_pts_pose.yaml").run()
@PytorchBootApplication("local_points_inference")
class LocalPointsInferenceApp:
@staticmethod
def start():
'''
call default or your custom runners here, code will be executed
automatically when type "pytorch-boot run" or "ptb run" in terminal
example:
Trainer("path_to_your_train_config").run()
Evaluator("path_to_your_eval_config").run()
'''
LocalPointsInferencer("./configs/local/local_only_inference_config.yaml").run()
@PytorchBootApplication("real_global_only_inference")
class RealGlobalOnlyInferenceApp:
@staticmethod
def start():
'''
call default or your custom runners here, code will be executed
automatically when type "pytorch-boot run" or "ptb run" in terminal
example:
Trainer("path_to_your_train_config").run()
Evaluator("path_to_your_eval_config").run()
'''
GlobalPointsInferencer("./configs/local/real_global_only_inference_config.yaml").run()
@PytorchBootApplication("mlp_inference")
class MLPInferenceApp:
@staticmethod
def start():
GlobalAndLocalPointsInferencer("./configs/local/mlp_inference_config.yaml").run()
@PytorchBootApplication("server")
class InferenceServerApp:
@staticmethod
def start():
'''
call default or your custom runners here, code will be executed
automatically when type "pytorch-boot run" or "ptb run" in terminal
example:
Trainer("path_to_your_train_config").run()
Evaluator("path_to_your_eval_config").run()
'''
InferencerServer("./configs/server/server_inference_server_config.yaml").run()
@PytorchBootApplication("evaluate_uncertainty_guide")
class EvaluateUncertaintyGuideApp:
@staticmethod
def start():
'''
call default or your custom runners here, code will be executed
automatically when type "pytorch-boot run" or "ptb run" in terminal
example:
Trainer("path_to_your_train_config").run()
Evaluator("path_to_your_eval_config").run()
'''
EvaluateUncertaintyGuide("./configs/local/uncertainty_guide_evaluation_config.yaml").run()
@PytorchBootApplication("evaluate_pbnbv")
class EvaluatePBNBVApp:
@staticmethod
def start():
EvaluatePBNBV("./configs/local/pbnbv_evalutaion_config.yaml").run()