-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
type: fix description: - libraries are imported with a try/catch so development and building be easy to work with. - setup.py packages correctly the impy folder
- Loading branch information
Showing
12 changed files
with
167 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
# Builds | ||
build/ | ||
dist/ | ||
impy.egg-info/ | ||
|
||
# IDE foldres | ||
.idea | ||
.vscode | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
""" | ||
Author: Rodrigo Loza | ||
Email: [email protected] | ||
Description: Testing units for ImageLocalizationDataset. | ||
Description: Unit tests for ObjectDetectionDataset. | ||
""" | ||
import os | ||
import unittest | ||
|
@@ -11,8 +11,8 @@ | |
class ObjectDetectionDataset_test(unittest.TestCase): | ||
|
||
def setUp(self): | ||
self.imgs = os.path.join(os.getcwd(), "tests", "cars_dataset", "images") | ||
self.annts = os.path.join(os.getcwd(), "tests", "cars_dataset", "annotations", "xmls") | ||
self.imgs = os.path.join(os.getcwd(), "../", "../", "cars_dataset", "images") | ||
self.annts = os.path.join(os.getcwd(), "../", "../", "cars_dataset", "annotations", "xmls") | ||
self.imda = ObjectDetectionDataset(imagesDirectory = self.imgs, | ||
annotationsDirectory = self.annts, | ||
databaseName = "unit_test") | ||
|
@@ -21,24 +21,31 @@ def tearDown(self): | |
pass | ||
|
||
def test_bounding_boxes(self): | ||
outputDirectory = os.path.join(os.getcwd(), "tests", "cars_dataset", "bounding_boxes") | ||
os.system("rm {}/*".format(outputDirectory)) | ||
outputDirectory = os.path.join(os.getcwd(), "../", "../", "cars_dataset", "bounding_boxes") | ||
os.system("rm -r {}".format(outputDirectory)) | ||
os.mkdir("../../cars_dataset/bounding_boxes") | ||
self.imda.saveBoundingBoxes(outputDirectory = outputDirectory, filterClasses = ["pedestrian", "car"]) | ||
|
||
def test_reduceDatasetByRois(self): | ||
outputImageDirectory = os.path.join(os.getcwd(), "tests", "cars_dataset", "images_reduced") | ||
outputAnnotationDirectory = os.path.join(os.getcwd(), "tests", "cars_dataset", "annotations_reduced", "xmls") | ||
os.system("rm {}/*".format(outputImageDirectory)) | ||
os.system("rm {}/*".format(outputAnnotationDirectory)) | ||
outputImageDirectory = os.path.join(os.getcwd(), "../", "../", "cars_dataset", "images_reduced") | ||
outputAnnotationDirectory = os.path.join(os.getcwd(), "../", "../", "cars_dataset", "annotations_reduced", "xmls") | ||
os.system("rm -r {}".format(outputImageDirectory)) | ||
os.system("rm -r {}".format(os.path.join(os.getcwd(), "../", "../", "cars_dataset", "annotations_reduced"))) | ||
os.mkdir("../../cars_dataset/images_reduced/") | ||
os.mkdir("../../cars_dataset/annotations_reduced/") | ||
os.mkdir("../../cars_dataset/annotations_reduced/xmls/") | ||
# Reduce dataset by grouping ROIs into smaller frames. | ||
self.imda.reduceDatasetByRois(offset = [300, 300], | ||
outputImageDirectory = outputImageDirectory, | ||
outputAnnotationDirectory = outputAnnotationDirectory) | ||
|
||
def test_reduceImageDataPointByRoi(self): | ||
outputImageDirectory = os.path.join(os.getcwd(), "tests", "cars_dataset", "images_reduced_single") | ||
outputAnnotationDirectory = os.path.join(os.getcwd(), "tests", "cars_dataset", "annotations_reduced_single", "xmls") | ||
os.system("rm {}/* {}/*".format(outputImageDirectory, outputAnnotationDirectory)) | ||
outputImageDirectory = os.path.join(os.getcwd(), "../", "../", "cars_dataset", "images_reduced_single") | ||
outputAnnotationDirectory = os.path.join(os.getcwd(), "../", "../", "cars_dataset", "annotations_reduced_single", "xmls") | ||
os.system("rm -r {} {}".format(outputImageDirectory, os.path.join(os.getcwd(), "../", "../", "cars_dataset", "annotations_reduced_single"))) | ||
os.mkdir("../../cars_dataset/images_reduced_single/") | ||
os.mkdir("../../cars_dataset/annotations_reduced_single/") | ||
os.mkdir("../../cars_dataset/annotations_reduced_single/xmls/") | ||
offset = 300 | ||
for i in range(1): | ||
for each in os.listdir(self.imgs): | ||
|
@@ -57,11 +64,14 @@ def test_reduceImageDataPointByRoi(self): | |
offset += 250 | ||
|
||
def test_applyDataAugmentation(self): | ||
outputImageDirectory = os.path.join(os.getcwd(), "tests", "cars_dataset", "images_augmented") | ||
outputAnnotationDirectory = os.path.join(os.getcwd(), "tests", "cars_dataset", "annotations_augmented", "xmls") | ||
os.system("rm {}/*".format(outputImageDirectory)) | ||
os.system("rm {}/*".format(outputAnnotationDirectory)) | ||
aug_file = os.path.join(os.getcwd(), "tests", "cars_dataset", "aug_configuration_cars.json") | ||
outputImageDirectory = os.path.join(os.getcwd(), "../", "../", "cars_dataset", "images_augmented") | ||
outputAnnotationDirectory = os.path.join(os.getcwd(), "../", "../", "cars_dataset", "annotations_augmented", "xmls") | ||
os.system("rm -r {}".format(outputImageDirectory)) | ||
os.system("rm -r {}".format(os.path.join(os.getcwd(), "../", "../", "cars_dataset", "annotations_augmented"))) | ||
os.mkdir("../../cars_dataset/images_augmented/") | ||
os.mkdir("../../cars_dataset/annotations_augmented/") | ||
os.mkdir("../../cars_dataset/annotations_augmented/xmls/") | ||
aug_file = os.path.join(os.getcwd(), "../", "../", "cars_dataset", "aug_configuration_cars.json") | ||
self.imda.applyDataAugmentation(configurationFile = aug_file, | ||
outputImageDirectory = outputImageDirectory, | ||
outputAnnotationDirectory = outputAnnotationDirectory) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
setuptools.setup( | ||
name="impy", | ||
version="0.1", | ||
version="1.0", | ||
author="Rodrigo Alejandro Loza Lucero", | ||
author_email="[email protected]", | ||
description="A library to apply data augmentation to your image datasets", | ||
|
@@ -33,4 +33,4 @@ | |
"License :: OSI Approved :: APACHE", | ||
"Operating System :: OS Independent", | ||
], | ||
) | ||
) |