-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from umd-fire-coml/Preprocessor-Read-images
Merge Preprocessor read images
- Loading branch information
Showing
8 changed files
with
83 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: run_all_tests | ||
|
||
on: [push, pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
RunAllTests: | ||
runs-on: ubuntu-latest | ||
container: python | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: run_all_tests | ||
run: | | ||
pip install -r requirements.txt | ||
pip install -r test-requirements.txt | ||
python -m pytest | ||
Empty file.
Empty file.
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import os | ||
|
||
|
||
|
||
def getAllImages(imageFolder): | ||
images = [] | ||
|
||
for path, subdirs, files in os.walk(imageFolder): | ||
for name in files: | ||
images.append(os.path.join(path,name)) | ||
|
||
return images |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
pytest |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import os | ||
import test | ||
import pathlib | ||
import sys | ||
sys.path.insert(0, './src') | ||
|
||
from getAllImagesFunction import getAllImages | ||
|
||
|
||
def test_images(): | ||
|
||
imageFolder = r"/getAllImagesFolder" #folder with all the images | ||
|
||
imageFolderPath = os.getcwd()+ imageFolder | ||
imageFolderPath.encode('unicode_escape') | ||
|
||
print (imageFolderPath) | ||
|
||
images = getAllImages(imageFolderPath) | ||
|
||
imagesRel = [] | ||
|
||
for image in images: | ||
image = os.path.relpath(image, imageFolderPath) | ||
imagesRel.append(image) | ||
|
||
|
||
print(len(imagesRel)) | ||
assert len(imagesRel) == 2 | ||
|
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from src.getAllImagesFunction import * | ||
import os | ||
|
||
|
||
imageFolder = "\getAllImagesFolder" #folder with all the images | ||
|
||
imageFolderPath = os.getcwd()+ imageFolder | ||
imageFolderPath.encode('unicode_escape') | ||
|
||
print (imageFolderPath) | ||
|
||
images = getAllImages(imageFolderPath) | ||
|
||
imagesRel = [] | ||
|
||
for image in images: | ||
image = os.path.relpath(image, imageFolderPath) | ||
imagesRel.append(image) | ||
|
||
|
||
|
||
|
||
print(imagesRel) |