Esempio n. 1
0
 private static void scale(FsPath smallImg, FsPath zoomImg)
 {
     if (isZoomed(smallImg))
     {
         File.Copy(smallImg.Value, zoomImg.Value);
     }
     else
     {
         WaifuScaler.Scale(smallImg, zoomImg);
     }
 }
Esempio n. 2
0
        public void PreProcessImages(
            string sourceDir,
            string targetDir,
            string subdir)
        {
            string sourceSubdir = Path.Combine(sourceDir, subdir);
            string targetSubdir = Path.Combine(targetDir, subdir);

            Directory.CreateDirectory(targetSubdir);

            var sourceImages = Directory.GetFiles(sourceSubdir);

            foreach (var sourceImage in sourceImages)
            {
                var targetImage = sourceImage.Replace(sourceDir, targetDir);

                if (!File.Exists(targetImage))
                {
                    WaifuScaler.Scale(sourceImage, targetImage);
                }
            }
        }
Esempio n. 3
0
        public void PreProcessImages(
            string smallDir,
            string zoomDir,
            string pngSubdir,
            string jpgSubdir)
        {
            string smallPngDir = Path.Combine(smallDir, pngSubdir);
            string zoomPngDir  = Path.Combine(zoomDir, pngSubdir);

            Directory.CreateDirectory(zoomPngDir);
            var smallImages = Directory.GetFiles(smallPngDir);

            foreach (var smallImage in smallImages)
            {
                var zoomImage = smallImage.Replace(smallDir, zoomDir);

                if (!File.Exists(zoomImage))
                {
                    WaifuScaler.Scale(smallImage, zoomImage);
                }
            }

            var dirs = new[]