コード例 #1
0
ファイル: runtest_interface.py プロジェクト: tsizemo2/APT
# APT_interface.main(cmd.split())

## stephen for multi view
lbl_file = '/groups/branson/bransonlab/mayank/PoseTF/data/apt_interface/stephen/shdl_stripped_homogeneousims_modified.lbl'
mov_files = ['/groups/branson/bransonlab/mayank/PoseTF/data/apt_interface/stephen/fly516/C001H001S0001/C001H001S0001_c.avi',
            '/groups/branson/bransonlab/mayank/PoseTF/data/apt_interface/stephen/fly516/C002H001S0001/C002H001S0001_c.avi']
out_files = []
for mov_file in mov_files:
    out_files.append(os.path.splitext(mov_file)[0] + '_interface_test_{}.trk'.format(dstr))

name = 'stephen_test_apt'
cmd = '{} -name {} train'.format(lbl_file,name)
#APT_interface.main(cmd.split())
cmd = '{} -name {} track -mov {} {} -out {} {}'.format(
    lbl_file, name, mov_files[0], mov_files[1], out_files[0], out_files[1])
#APT_interface.main(cmd.split())



## Alice: for projects with trx files.
lbl_file = '/groups/branson/bransonlab/mayank/PoseTF/data/alice/multitarget_bubble_expandedbehavior_20180425_modified.lbl'
mov_file = '/groups/branson/bransonlab/mayank/PoseTF/data/apt_interface/alice/cx_GMR_SS00168_CsChr_RigD_20150909T111218/movie.ufmf'
trx_file = '/groups/branson/bransonlab/mayank/PoseTF/data/apt_interface/alice/cx_GMR_SS00168_CsChr_RigD_20150909T111218/registered_trx.mat'
out_file = os.path.splitext(mov_file)[0] + '_interface_test_{}.trk'.format(dstr)
name = 'alice_test_apt'
cmd = '{} -name {} train'.format(lbl_file,name)
#APT_interface.main(cmd.split())
cmd = '{} -name {} track -mov {} -trx {} -out {} -end_frame 1000'.format(lbl_file, name, mov_file, trx_file, out_file)
APT_interface.main(cmd.split())

コード例 #2
0
cmd = '-name 20191206T024459 -view 1 -cache /groups/branson/home/kabram/.apt/tp0812543a_6893_40b2_befd_90409dbe6afe -err_file /groups/branson/home/kabram/.apt/tp0812543a_6893_40b2_befd_90409dbe6afe/test1/20191206T024459view0_20191206T0245171.err -type mdn /groups/branson/home/kabram/.apt/tp0812543a_6893_40b2_befd_90409dbe6afe/test1/20191206T024459_20191206T024517.lbl train -use_cache -skip_db'

import APT_interface as apt
apt.main(cmd.split())

##
import run_apt_expts as rae
reload(rae)
rae.setup('leap_fly')
rae.create_gt_db()

##
import APT_interface as apt
cmd = '/groups/branson/bransonlab/apt/experiments/data/multitarget_bubble_expandedbehavior_20180425_FxdErrs_OptoParams20181126_dlstripped.lbl -name alice_randsplit_round_4 -cache /nrs/branson/mayank/apt_cache -conf_params use_pretrained_weights False  batch_size 8  trange 5  decay_steps 20000  save_step 4000  rrange 10  adjust_contrast False  mdn_use_unet_loss True  dl_steps 40000  normalize_img_mean False  maxckpt 20  -type mdn  -train_name no_pretrained  -view 1 train -skip_db -use_cache'
import os
os.environ['CUDA_VISIBLE_DEVICES'] = ''
apt.main(cmd.split())

##
import run_apt_expts as rae
reload(rae)
rae.setup('romain', 0)
rae.get_cv_results(num_splits=6)

##
import PoseTools
import os
import glob
import APT_interface as apt
import apt_expts
import re
コード例 #3
0
ファイル: debug_apt_interface.py プロジェクト: mkabra/poseTF
# import PoseUMDN_dataset
# self = PoseUMDN_dataset.PoseUMDN(conf,name='pose_umdn_test')

import PoseUNet_dataset

self = PoseUNet_dataset.PoseUNet(conf,name='pose_unet_fusion')

self.train_unet()

##
import os
os.environ['CUDA_VISIBLE_DEVICES'] = ''
args =  '-name pend -cache /home/mayank/temp -type unet /home/mayank/work/poseTF/data/apt/pend_1_stripped_preProcDataCache_scale4_NumChans1_v73.lbl train -use_cache'
args = args.split()
import APT_interface as apt
apt.main(args)


##
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
from poseConfig import aliceConfig as conf
import tensorflow as tf
import multiResData
conf.trange = 5
conf.cachedir += '_dataset'
import mdn_keras
mdn_keras.training(conf)

##
from poseConfig import aliceConfig as conf
コード例 #4
0
ファイル: test_apt.py プロジェクト: tsizemo2/APT
gt_file_url = 'https://www.dropbox.com/s/71glyy7bgkry7sm/gtdata_view0.tfrecords?dl=1'
gt_file = os.path.join(tdir, 'gt_data.tfrecords')
url_lib.urlretrieve(gt_file_url, gt_file)

res_file_url = 'https://www.dropbox.com/s/cr702321rvv3htl/alice_view0_time.mat?dl=1'
res_file = os.path.join(tdir,'alice_view0_time.mat')
url_lib.urlretrieve(res_file_url,res_file)

cmd = '-cache {} -name {} -conf_params batch_size {} dl_steps {} op_affinity_graph {} -type {{}} {} train -use_cache '.format(tdir, exp_name, bsz, dl_steps,op_af_graph, lbl_file)

##
import h5py
R = h5py.File(res_file,'r')

for net in net_types:
    apt.main(cmd.format(net).split())

    conf = apt.create_conf(lbl_file, 0, exp_name, tdir, net)
    # if data_type == 'stephen' and train_type == 'mdn':
    #     conf.mdn_use_unet_loss = False
    if op_af_graph is not None:
        conf.op_affinity_graph = ast.literal_eval(op_af_graph.replace('\\', ''))
    files = glob.glob(os.path.join(conf.cachedir, "{}-[0-9]*").format('deepnet'))
    files.sort(key=os.path.getmtime)
    files = [f for f in files if os.path.splitext(f)[1] in ['.index', '']]
    aa = [int(re.search('-(\d*)', f).groups(0)[0]) for f in files]
    aa = [b - a for a, b in zip(aa[:-1], aa[1:])]
    if any([a < 0 for a in aa]):
        bb = int(np.where(np.array(aa) < 0)[0]) + 1
        files = files[bb:]
    files = files[-1:]