Exemplo n.º 1
0
import argparse, pdb, sys
from cichlid_bower_tracking.data_preparers.project_preparer import ProjectPreparer as PP

parser = argparse.ArgumentParser(
    usage=
    'This script will perform inital analysis of depth data to create a smoothed, interpolated, 3D npy array'
)
parser.add_argument('ProjectID',
                    type=str,
                    help='Which projectID you want to identify')
parser.add_argument('Number',
                    type=int,
                    help='Total number of videos to label for this project')
parser.add_argument('Initials', type=str, help='Initials of annotator')

args = parser.parse_args()

if len(args.Initials) != 3:
    print('Initials must be three letters long')
    sys.exit()

pp_obj = PP(args.ProjectID)
pp_obj.manuallyLabelFrames(args.Initials.upper(), args.Number)
Exemplo n.º 2
0
    'MLType',
    type=str,
    choices=['3DResnet', 'RCNN'],
    help=
    'Choose between a 3D Resnet for classifying videos or an RCNN to identify fish'
)
parser.add_argument('ModelID', type=str, help='Name of the model created')
parser.add_argument('--ProjectIDs',
                    nargs='+',
                    type=str,
                    help='Restrict training data to the following ProjectIDs')
parser.add_argument('--GPU',
                    type=str,
                    default='0',
                    help='Specify the GPU card to use')

args = parser.parse_args()

subprocess.run([
    'python3', '-m', 'cichlid_bower_tracking.unit_scripts.download_data',
    'Train' + args.MLType, '--ModelID', args.ModelID
])

pp_obj = PP(projectID=None, modelID=args.ModelID)
pp_obj.createModel(args.MLType, args.ProjectIDs, args.GPU)

subprocess.run([
    'python3', '-m', 'cichlid_bower_tracking.unit_scripts.upload_data',
    'Train' + args.MLType, '--ModelID', args.ModelID, '--Delete'
])
import argparse, pdb
from cichlid_bower_tracking.data_preparers.project_preparer import ProjectPreparer as PP

parser = argparse.ArgumentParser(
    usage=
    'This script will perform inital analysis of depth data to create a smoothed, interpolated, 3D npy array'
)
parser.add_argument('ProjectID',
                    type=str,
                    help='Which projectID you want to identify')
parser.add_argument('--VideoIndex',
                    type=int,
                    help='Index of video that should be analyzed')
parser.add_argument('--Workers',
                    type=int,
                    help='Number of threads to run this analysis in parallel')
args = parser.parse_args()

pp_obj = PP(args.ProjectID, workers=args.Workers)

pp_obj.runClusterAnalysis(args.VideoIndex)
Exemplo n.º 4
0
import argparse
from cichlid_bower_tracking.data_preparers.project_preparer import ProjectPreparer as PP

parser = argparse.ArgumentParser(
    usage=
    'This script is run after analysis to create useful figures and summary files'
)
parser.add_argument('ProjectID',
                    type=str,
                    help='Which projectID you want to identify')
parser.add_argument('--SummaryFile',
                    type=str,
                    help='Name of csv file that specifies projects to analyze',
                    default=None)
args = parser.parse_args()

pp_obj = PP(args.ProjectID, summaryFile=args.SummaryFile)

pp_obj.runSummaryCreation()
                        'ManualLabelVideos', 'ManualLabelFrames', 'Summary',
                        'All'
                    ],
                    help='What type of analysis to perform')
parser.add_argument(
    '--ProjectID',
    type=str,
    help=
    'Manually identify the projects you want to analyze. If All is specified, all non-prepped projects will be analyzed'
)
parser.add_argument(
    '--VideoIndex',
    type=int,
    help=
    'Specify which video should be downloaded if Cluster analysis is to be performed'
)
parser.add_argument('--ModelID',
                    type=str,
                    help='Specify a ModelID to download')
parser.add_argument('--SummaryFile',
                    type=str,
                    help='Name of csv file that specifies projects to analyze',
                    default=None)

args = parser.parse_args()

#print('Downloading data for ' + args.ProjectID, file = sys.stderr)

pp_obj = PP(args.ProjectID, args.ModelID, summaryFile=args.SummaryFile)
pp_obj.downloadData(args.DataType, videoIndex=args.VideoIndex)
                        'Prep', 'Depth', 'Cluster', 'ClusterClassification',
                        'Train3DResnet', 'ManualLabelVideos', 'Summary', 'All'
                    ],
                    help='What type of analysis to perform')
parser.add_argument(
    '--ProjectID',
    type=str,
    help=
    'Manually identify the projects you want to analyze. If All is specified, all non-prepped projects will be analyzed'
)
parser.add_argument(
    '--VideoIndex',
    type=int,
    help=
    'Specify which video should be downloaded if Cluster analysis is to be performed'
)
parser.add_argument('--ModelID',
                    type=str,
                    help='Specify a ModelID to download')
parser.add_argument('--Delete',
                    action='store_true',
                    help='Delete data once it is uploaded')
parser.add_argument('--NoUpload',
                    action='store_true',
                    help='Do not upload data (but still delete it)')

args = parser.parse_args()

pp_obj = PP(args.ProjectID, args.ModelID)
pp_obj.uploadData(args.DataType, args.VideoIndex, args.Delete, args.NoUpload)
Exemplo n.º 7
0
import argparse, subprocess
from cichlid_bower_tracking.data_preparers.project_preparer import ProjectPreparer as PP

parser = argparse.ArgumentParser(
    usage=
    'This script will prompt user to identify tray location and registration info between depth and video data. Works on a single projectID'
)
parser.add_argument('ProjectID',
                    type=str,
                    help='Manually identify the project you want to analyze')
args = parser.parse_args()

pp_obj = PP(args.ProjectID)
pp_obj.runPrepAnalysis()
import argparse, pdb, sys
from cichlid_bower_tracking.data_preparers.project_preparer import ProjectPreparer as PP

parser = argparse.ArgumentParser(
    usage=
    'This script will use a previously trained 3D Resnet model to classify videos'
)
parser.add_argument('ProjectID',
                    type=str,
                    help='Which projectID you want to identify')
args = parser.parse_args()

print('Analyzing depth data for ' + args.ProjectID, file=sys.stderr)

pp_obj = PP(args.ProjectID)
pp_obj.runDepthAnalysis()