コード例 #1
0
import os
import warnings
warnings.filterwarnings('ignore')
import numpy as np
import preprocessing

if __name__ == '__main__':
    INPUT_FOLDER = 'C:/Users/KNatarajan/Desktop/Project/stage1'
    OUTPUT_FOLDER = 'C:/Users/KNatarajan/Desktop/Project/output'
    preprocessing.full_prep(INPUT_FOLDER, OUTPUT_FOLDER)
コード例 #2
0
from utils import *
from split_combine import SplitComb
from test_detect import test_detect
from importlib import import_module
import pandas

datapath = config_submit['datapath']
prep_result_path = config_submit['preprocess_result_path']
skip_prep = config_submit['skip_preprocessing']
skip_detect = config_submit['skip_detect']

if not skip_prep:
    testsplit = full_prep(
        datapath,
        prep_result_path,
        n_worker=config_submit['n_worker_preprocessing'],
        use_existing=config_submit['use_exsiting_preprocessing'])
else:
    testsplit = os.listdir(datapath)

print("nodmodel")
nodmodel = import_module(config_submit['detector_model'].split('.py')[0])
print("nodmodel.get_model()")
config1, nod_net, loss, get_pbb = nodmodel.get_model()
print("torch.load")
checkpoint = torch.load(config_submit['detector_param'])
print("nod_net.load_state_dict")
nod_net.load_state_dict(checkpoint['state_dict'])

torch.cuda.set_device(0)
コード例 #3
0
ファイル: main.py プロジェクト: ericsolo/python
from data_classifier import DataBowl3Classifier

from utils import *
from split_combine import SplitComb
from test_detect import test_detect
from importlib import import_module
import pandas

datapath = config_submit['datapath']
prep_result_path = config_submit['preprocess_result_path']
skip_prep = config_submit['skip_preprocessing']
skip_detect = config_submit['skip_detect']

if not skip_prep:
    testsplit = full_prep(datapath,prep_result_path,
                          n_worker = config_submit['n_worker_preprocessing'],
                          use_existing=config_submit['use_exsiting_preprocessing'])
else:
    testsplit = os.listdir(datapath)

nodmodel = import_module(config_submit['detector_model'].split('.py')[0])
config1, nod_net, loss, get_pbb = nodmodel.get_model()
checkpoint = torch.load(config_submit['detector_param'])
nod_net.load_state_dict(checkpoint['state_dict'])

torch.cuda.set_device(0)
nod_net = nod_net.cuda()
cudnn.benchmark = True
nod_net = DataParallel(nod_net)

bbox_result_path = './bbox_result'