Skip to content

Commit f860d62

Browse files
committed
Add tests for dataloader
Upload dataset temp Resolve merge conflicts Resolve merge conflicts Resolve merge conflicts Resolve merge conflicts Style fixes Set up constructor Complete Dataloader, write function definition for image dataloader Build Fixed, Style Fixed style fixed Fix linux and Windows build by ignoring invalid files like .DS_Store Add image dataloader, needs clean up Style fixes Check for file type Check for correct extention and filetype Style Fixed
1 parent a975740 commit f860d62

18 files changed

+452
-246
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@ xcode*
33
.DS_Store
44
.idea
55
cmake-build-*
6+
data/*
67
*.csv
78
*.tar
89
*.zip
910
*.tar.gz
11+
*.xml
12+
*.jpeg
13+
*.jpg
14+
*.png
15+
*.txt
1016
.travis/configs.hpp
1117
Testing/*

augmentation/augmentation.hpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ template<typename DatasetType = arma::mat>
3131
class Augmentation
3232
{
3333
public:
34-
//! Create the augmenation class object.
34+
//! Create the augmentation class object.
3535
Augmentation();
3636

3737
/**
3838
* Constructor for augmentation class.
3939
*
4040
* @param augmentations List of strings containing one of the supported
41-
* augmentation.
41+
* augmentations.
4242
* @param augmentationProbability Probability of applying augmentation on
4343
* the dataset.
4444
* NOTE : This doesn't apply to augmentations
@@ -95,9 +95,8 @@ class Augmentation
9595
bool HasResizeParam(const std::string& augmentation = "")
9696
{
9797
if (augmentation.length())
98-
{
9998
return augmentation.find("resize") != std::string::npos;
100-
}
99+
101100

102101
// Search in augmentation vector.
103102
return augmentations.size() <= 0 ? false :
@@ -117,9 +116,8 @@ class Augmentation
117116
const std::string& augmentation)
118117
{
119118
if (!HasResizeParam())
120-
{
121119
return;
122-
}
120+
123121

124122
outWidth = 0;
125123
outHeight = 0;

augmentation/augmentation_impl.hpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ Augmentation<DatasetType>::Augmentation(
3131
augmentationProbability(augmentationProbability)
3232
{
3333
// Sort the vector to place resize parameter to the front of the string.
34-
// This prevents constant look ups for resize.
34+
// This prevents constant lookups for resize.
3535
sort(this->augmentations.begin(), this->augmentations.end(), [](
3636
std::string& str1, std::string& str2)
37-
{
38-
return str1.find("resize") != std::string::npos;
39-
});
37+
{
38+
return str1.find("resize") != std::string::npos;
39+
});
4040

4141
// Fill augmentation map with supported augmentations other than resize.
4242
InitializeAugmentationMap();
@@ -75,9 +75,7 @@ void Augmentation<DatasetType>::ResizeTransform(
7575
const std::string& augmentation)
7676
{
7777
if (!this->HasResizeParam(augmentation))
78-
{
7978
return;
80-
}
8179

8280
size_t outputWidth = 0, outputHeight = 0;
8381

@@ -93,7 +91,7 @@ void Augmentation<DatasetType>::ResizeTransform(
9391
// Not sure how to avoid a copy here.
9492
DatasetType output;
9593
resizeLayer.Forward(dataset, output);
96-
dataset = output;
94+
dataset = std::move(output);
9795
}
9896

9997
template<typename DatasetType>

data/PASCAL-VOC-Test.tar.gz

606 KB
Binary file not shown.

data/annotations/2007_000027.xml

Lines changed: 0 additions & 63 deletions
This file was deleted.

data/annotations/2007_000032.xml

Lines changed: 0 additions & 63 deletions
This file was deleted.

data/cifar-test.tar.gz

66.6 KB
Binary file not shown.

data/images/2007_000027.jpg

-142 KB
Binary file not shown.

data/images/2007_000032.jpg

-53.5 KB
Binary file not shown.

data/pascal-voc-classes.txt

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)