File size: 1,040 Bytes
4c62147
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import torch

from torchtask.utils import logger


def task_func():
    return TaskFunc
    

class TaskFunc:
    # special indetifier for the metric elements
    METRIC_STR = 'metric'
    
    def __init__(self, args=None):
        self.args = args

    # ---------------------------------------------------------------------
    # Functions for All Tasks
    # Following functions are required by all tasks.
    # ---------------------------------------------------------------------

    def metrics(self, pred, gt, inp, meters, id_str=''):
        logger.log_warn('No implementation of the \'metrics\' function for current task.\n'
                        'Please implement it in \'task/xxx/func.py\'.\n')

    def visualize(self, out_path, id_str='', inp=None, pred=None, gt=None):
        logger.log_warn('No implementation of the \'visulize\' function for current task.\n'
                        'Please implement it in \'task/xxx/func.py\'.\n')
         
    # ---------------------------------------------------------------------