Esempio n. 1
0
        public static bool PreprocessSubmittedData(SatyamJobSubmissionsTableAccessEntry jobEntry)
        {
            string    satyamContainerName = JobTemplateToSatyamContainerNameMap[jobEntry.JobTemplateType];
            string    GUID = jobEntry.JobGUID;
            string    satyamDirectoryName = GUID;
            SatyamJob job     = JSonUtils.ConvertJSonToObject <SatyamJob>(jobEntry.JobParametersString);
            bool      success = false;

            switch (job.JobTemplateType)
            {
            case TaskConstants.TrackletLabeling:
            case TaskConstants.TrackletLabeling_MTurk:
                success = VATIC_Tracklet.ProcessAndUploadToAzureBlob(jobEntry);
                break;

            case TaskConstants.Tracking:
            case TaskConstants.Tracking_MTurk:
                success = TrackingDataPreprocessor.ProcessAndUploadToAzureBlob(jobEntry);
                break;

            case TaskConstants.Classification_Video:
            case TaskConstants.Classification_Video_MTurk:
                success = VideoClassficationPreprocessor.ProcessAndUploadToAzureBlob(jobEntry);
                break;

            case TaskConstants.Classification_Image:
            case TaskConstants.Classification_Image_MTurk:
            case TaskConstants.Counting_Image:
            case TaskConstants.Counting_Image_MTurk:
            case TaskConstants.Counting_Video:
            case TaskConstants.Counting_Video_MTurk:
            case TaskConstants.Detection_Image:
            case TaskConstants.Detection_Image_MTurk:
            case TaskConstants.Segmentation_Image:
            case TaskConstants.Segmentation_Image_MTurk:
            case TaskConstants.OpenEndedQuestion_Image:
            case TaskConstants.OpenEndedQuestion_Image_MTurk:
            default:
                // all the images to satyam location
                success = DefaultDataPreprocessor.copyDataFromUserBlobToSatyamBlob(jobEntry);
                break;
            }


            return(success);
        }
Esempio n. 2
0
        public static void writeTrackletsIntoVIRAT(Dictionary <string, VATIC_Tracklet> tracklets, string outputFilePath)
        {
            List <string> output = new List <string>();

            foreach (string key in tracklets.Keys)
            {
                VATIC_Tracklet tck = tracklets[key];

                for (int i = 0; i < tck.boxes.Count; i++)
                {
                    string objId   = key;
                    int    objType = tck.label;
                    int    frameId = Convert.ToInt32(tck.boxes[i][4]);
                    int    xtl     = Convert.ToInt32(tck.boxes[i][0]);
                    int    ytl     = Convert.ToInt32(tck.boxes[i][1]);
                    int    xbr     = Convert.ToInt32(tck.boxes[i][2]);
                    int    ybr     = Convert.ToInt32(tck.boxes[i][3]);
                    int    width   = xbr - xtl;
                    int    height  = ybr - ytl;

                    List <string> line = new List <string>();
                    line.Add(objId);
                    line.Add("0");
                    line.Add(frameId.ToString());
                    line.Add(xtl.ToString());
                    line.Add(ytl.ToString());
                    line.Add(width.ToString());
                    line.Add(height.ToString());
                    line.Add(objType.ToString());

                    string ln = ObjectsToStrings.ListString(line, ' ');
                    output.Add(ln);
                }

                File.WriteAllLines(outputFilePath, output);
            }
        }