Skip to content

Commit 78c406c

Browse files
yaeldMScodemzs
authored andcommitted
Add aka.ms aliases for files downloaded from Azure blobs (dotnet#4523)
* update tlcresources links * Update more links * update more links * Undo changes in Samples project
1 parent 6ae3a3f commit 78c406c

File tree

7 files changed

+21
-36
lines changed

7 files changed

+21
-36
lines changed

docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/MulticlassClassification/ImageClassification/ImageClassificationDefault.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,7 @@ public static string DownloadImageSet(string imagesDownloadFolder)
242242

243243
//SINGLE SMALL FLOWERS IMAGESET (200 files)
244244
string fileName = "flower_photos_small_set.zip";
245-
string url = $"https://mlnetfilestorage.file.core.windows.net/" +
246-
$"imagesets/flower_images/flower_photos_small_set.zip?st=2019-08-" +
247-
$"07T21%3A27%3A44Z&se=2030-08-08T21%3A27%3A00Z&sp=rl&sv=2018-03-" +
248-
$"28&sr=f&sig=SZ0UBX47pXD0F1rmrOM%2BfcwbPVob8hlgFtIlN89micM%3D";
245+
string url = $"https://aka.ms/mlnet-resources/datasets/flower_photos_small_set.zip";
249246

250247
Download(url, imagesDownloadFolder, fileName);
251248
UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder);

docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/MulticlassClassification/ImageClassification/LearningRateSchedulingCifarResnetTransferLearning.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public static string DownloadImageSet(string imagesDownloadFolder)
271271
// get a set of images to teach the network about the new classes
272272
// CIFAR dataset ( 50000 train images and 10000 test images )
273273
string fileName = "cifar10.zip";
274-
string url = $"https://tlcresources.blob.core.windows.net/" +
274+
string url = $"https://aka.ms/mlnet-resources/" +
275275
"datasets/cifar10.zip";
276276

277277
Download(url, imagesDownloadFolder, fileName);

docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/MulticlassClassification/ImageClassification/ResnetV2101TransferLearningEarlyStopping.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,7 @@ public static string DownloadImageSet(string imagesDownloadFolder)
230230

231231
//SINGLE SMALL FLOWERS IMAGESET (200 files)
232232
string fileName = "flower_photos_small_set.zip";
233-
string url = $"https://mlnetfilestorage.file.core.windows.net/" +
234-
$"imagesets/flower_images/flower_photos_small_set.zip?st=2019-08-" +
235-
$"07T21%3A27%3A44Z&se=2030-08-08T21%3A27%3A00Z&sp=rl&sv=2018-03-" +
236-
$"28&sr=f&sig=SZ0UBX47pXD0F1rmrOM%2BfcwbPVob8hlgFtIlN89micM%3D";
233+
string url = $"https://aka.ms/mlnet-resources/datasets/flower_photos_small_set.zip";
237234

238235
Download(url, imagesDownloadFolder, fileName);
239236
UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder);

docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/MulticlassClassification/ImageClassification/ResnetV2101TransferLearningTrainTestSplit.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,7 @@ public static string DownloadImageSet(string imagesDownloadFolder)
251251

252252
//SINGLE SMALL FLOWERS IMAGESET (200 files)
253253
string fileName = "flower_photos_small_set.zip";
254-
string url = $"https://mlnetfilestorage.file.core.windows.net/" +
255-
$"imagesets/flower_images/flower_photos_small_set.zip?st=2019-08-" +
256-
$"07T21%3A27%3A44Z&se=2030-08-08T21%3A27%3A00Z&sp=rl&sv=2018-03-" +
257-
$"28&sr=f&sig=SZ0UBX47pXD0F1rmrOM%2BfcwbPVob8hlgFtIlN89micM%3D";
254+
string url = $"https://aka.ms/mlnet-resources/datasets/flower_photos_small_set.zip";
258255

259256
Download(url, imagesDownloadFolder, fileName);
260257
UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder);

test/Microsoft.ML.AutoML.Tests/DatasetUtil.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ internal static class DatasetUtil
2626

2727
public static IDataView GetUciAdultDataView()
2828
{
29-
if(_uciAdultDataView == null)
29+
if (_uciAdultDataView == null)
3030
{
3131
var context = new MLContext();
3232
var uciAdultDataFile = DownloadUciAdultDataset();
@@ -69,7 +69,7 @@ private static string DownloadIfNotExists(string baseGitPath, string dataFile)
6969
}
7070
}
7171
}
72-
catch(Exception)
72+
catch (Exception)
7373
{
7474
}
7575
}
@@ -146,10 +146,7 @@ public static IEnumerable<ImageData> LoadImagesFromDirectory(string folder)
146146
public static string DownloadImageSet(string imagesDownloadFolder)
147147
{
148148
string fileName = "flower_photos_tiny_set_for_unit_tests.zip";
149-
string url = $"https://mlnetfilestorage.file.core.windows.net/imagesets" +
150-
$"/flower_images/flower_photos_tiny_set_for_unit_tests.zip?st=2019" +
151-
$"-08-29T00%3A07%3A21Z&se=2030-08-30T00%3A07%3A00Z&sp=rl&sv=2018" +
152-
$"-03-28&sr=f&sig=N8HbLziTcT61kstprNLmn%2BDC0JoMrNwo6yRWb3hLLag%3D";
149+
string url = $"https://aka.ms/mlnet-resources/datasets/flower_photos_tiny_set_for_unit_test.zip";
153150

154151
Download(url, imagesDownloadFolder, fileName);
155152
UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder);

test/Microsoft.ML.Benchmarks/ImageClassificationBench.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,7 @@ public static string DownloadImageSet(string imagesDownloadFolder)
139139

140140
//SINGLE SMALL FLOWERS IMAGESET (200 files)
141141
string fileName = "flower_photos_small_set.zip";
142-
string url = $"https://mlnetfilestorage.file.core.windows.net/" +
143-
$"imagesets/flower_images/flower_photos_small_set.zip?st=2019-08-" +
144-
$"07T21%3A27%3A44Z&se=2030-08-08T21%3A27%3A00Z&sp=rl&sv=2018-03-" +
145-
$"28&sr=f&sig=SZ0UBX47pXD0F1rmrOM%2BfcwbPVob8hlgFtIlN89micM%3D";
142+
string url = $"https://aka.ms/mlnet-resources/datasets/flower_photos_small_set.zip/";
146143

147144
Download(url, imagesDownloadFolder, fileName);
148145
UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder);

test/Microsoft.ML.Tests/ScenariosWithDirectInstantiation/TensorflowTests.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,12 +1316,12 @@ internal bool ShouldReuse(string workspacePath, string trainSetBottleneckCachedV
13161316
}
13171317
return isReuse;
13181318
}
1319-
1319+
13201320
internal (string, string, string, bool) getInitialParameters(ImageClassificationTrainer.Architecture arch, string finalImagesFolderName)
13211321
{
1322-
string trainSetBottleneckCachedValuesFileName = "TrainsetCached_" + finalImagesFolderName + "_" + (int) arch;
1323-
string validationSetBottleneckCachedValuesFileName = "validationsetCached_" + finalImagesFolderName + "_" + (int) arch;
1324-
string workspacePath = Path.Combine(TensorFlowScenariosTestsFixture.parentWorkspacePath, finalImagesFolderName + "_" + (int) arch);
1322+
string trainSetBottleneckCachedValuesFileName = "TrainsetCached_" + finalImagesFolderName + "_" + (int)arch;
1323+
string validationSetBottleneckCachedValuesFileName = "validationsetCached_" + finalImagesFolderName + "_" + (int)arch;
1324+
string workspacePath = Path.Combine(TensorFlowScenariosTestsFixture.parentWorkspacePath, finalImagesFolderName + "_" + (int)arch);
13251325
bool isReuse = ShouldReuse(workspacePath, trainSetBottleneckCachedValuesFileName, validationSetBottleneckCachedValuesFileName);
13261326
return (trainSetBottleneckCachedValuesFileName, validationSetBottleneckCachedValuesFileName, workspacePath, isReuse);
13271327
}
@@ -1368,9 +1368,9 @@ public void TensorFlowImageClassification(ImageClassificationTrainer.Architectur
13681368
.Transform(testDataset);
13691369

13701370
// Check if the bottleneck cached values already exist
1371-
var (trainSetBottleneckCachedValuesFileName, validationSetBottleneckCachedValuesFileName,
1372-
workspacePath, isReuse) = getInitialParameters(arch, finalImagesFolderName);
1373-
1371+
var (trainSetBottleneckCachedValuesFileName, validationSetBottleneckCachedValuesFileName,
1372+
workspacePath, isReuse) = getInitialParameters(arch, finalImagesFolderName);
1373+
13741374
var options = new ImageClassificationTrainer.Options()
13751375
{
13761376
FeatureColumnName = "Image",
@@ -1424,7 +1424,7 @@ public void TensorFlowImageClassification(ImageClassificationTrainer.Architectur
14241424

14251425
string[] directories = Directory.GetDirectories(fullImagesetFolderPath);
14261426
string[] labels = new string[directories.Length];
1427-
for(int j = 0; j < labels.Length; j++)
1427+
for (int j = 0; j < labels.Length; j++)
14281428
{
14291429
var dir = new DirectoryInfo(directories[j]);
14301430
labels[j] = dir.Name;
@@ -1813,21 +1813,21 @@ public static string DownloadImageSet(string imagesDownloadFolder)
18131813
{
18141814
string fileName = "flower_photos_tiny_set_for_unit_tests.zip";
18151815
string filenameAlias = "FPTSUT"; // FPTSUT = flower photos tiny set for unit tests
1816-
string url = "https://aka.ms/mlnet-resources/flower_photos_tiny_set_for_unit_test.zip";
1816+
string url = "https://aka.ms/mlnet-resources/datasets/flower_photos_tiny_set_for_unit_test.zip";
18171817

18181818
Download(url, imagesDownloadFolder, fileName);
18191819
UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder);
18201820
// Sometimes tests fail because the path is too long. So rename the dataset folder to a shorter directory.
1821-
if(!Directory.Exists(Path.Combine(imagesDownloadFolder, filenameAlias)))
1822-
Directory.Move(Path.Combine(imagesDownloadFolder, Path.GetFileNameWithoutExtension(fileName)), Path.Combine(imagesDownloadFolder,"FPTSUT"));
1821+
if (!Directory.Exists(Path.Combine(imagesDownloadFolder, filenameAlias)))
1822+
Directory.Move(Path.Combine(imagesDownloadFolder, Path.GetFileNameWithoutExtension(fileName)), Path.Combine(imagesDownloadFolder, "FPTSUT"));
18231823
return filenameAlias;
18241824
}
18251825

18261826
public static string DownloadBadImageSet(string imagesDownloadFolder)
18271827
{
18281828
string fileName = "CatsVsDogs_tiny_for_unit_tests.zip";
1829-
string url = $"https://tlcresources.blob.core.windows.net/datasets/" +
1830-
$"CatsVsDogs_tiny_for_unit_tests.zip";
1829+
string url = $"https://aka.ms/mlnet-resources/datasets/" +
1830+
$"CatsVsDogs_tiny_for_unit_tests.zip";
18311831

18321832
Download(url, imagesDownloadFolder, fileName);
18331833
UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder);

0 commit comments

Comments
 (0)