Example #1
0
        private static void SaveTldOutput(VideoFile video, string videoDir)
        {
            List <string> lines = new List <string>();

            foreach (KeyValuePair <int, IBoundingBox> pair in video.TldOutputs)
            {
                int          frame = pair.Key;
                IBoundingBox bb    = pair.Value;

                string line = frame.ToString();
                if (bb != null)
                {
                    line += " " + bb.Center.X + " " + bb.Center.Y + " " + bb.Size.Width + " " + bb.Size.Height;
                }
                lines.Add(line);
            }

            File.WriteAllLines(GetTldOutputFile(videoDir), lines.ToArray());
        }
Example #2
0
        public static void Save(VideoFile video)
        {
            string videoDir = GetVideoDirectory(video);

            if (!Directory.Exists(videoDir))
            {
                Directory.CreateDirectory(videoDir);
            }

            // delete previous session results if they exist
            string videoSessionDir = GetVideoSessionDirectory(video);

            if (Directory.Exists(videoSessionDir))
            {
                Utils.ClearFolder(videoSessionDir);
            }

            // create new empty session
            Directory.CreateDirectory(videoSessionDir);

            SaveTldOutput(video, videoSessionDir);
            SaveModelUpdates(video, videoSessionDir);
        }