Skip to content

Download images only when not present on disk and print warning messages when converting unsupported pixel format. #3625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 1, 2019

Conversation

codemzs
Copy link
Member

@codemzs codemzs commented Apr 30, 2019

fixes #3631
fixes #3638

@codecov
Copy link

codecov bot commented Apr 30, 2019

Codecov Report

Merging #3625 into master will increase coverage by <.01%.
The diff coverage is 85.5%.

@@            Coverage Diff             @@
##           master    #3625      +/-   ##
==========================================
+ Coverage   72.78%   72.78%   +<.01%     
==========================================
  Files         808      808              
  Lines      145548   145588      +40     
  Branches    16248    16250       +2     
==========================================
+ Hits       105931   105961      +30     
- Misses      35195    35203       +8     
- Partials     4422     4424       +2
Flag Coverage Δ
#Debug 72.78% <85.5%> (ø) ⬆️
#production 68.28% <90.47%> (-0.01%) ⬇️
#test 89.04% <83.33%> (-0.01%) ⬇️
Impacted Files Coverage Δ
...c/Microsoft.ML.SamplesUtils/SamplesDatasetUtils.cs 24.34% <0%> (-0.12%) ⬇️
src/Microsoft.ML.ImageAnalytics/ImageLoader.cs 83.03% <100%> (-1.52%) ⬇️
src/Microsoft.ML.ImageAnalytics/ImageGrayscale.cs 78.68% <100%> (+0.35%) ⬆️
...rosoft.ML.ImageAnalytics/VectorToImageTransform.cs 76.83% <100%> (+0.06%) ⬆️
...Microsoft.ML.ImageAnalytics/ImagePixelExtractor.cs 82.93% <100%> (+0.2%) ⬆️
src/Microsoft.ML.ImageAnalytics/ImageResizer.cs 85.71% <100%> (+0.3%) ⬆️
...cenariosWithDirectInstantiation/TensorflowTests.cs 90.22% <83.33%> (-0.61%) ⬇️
src/Microsoft.ML.Transforms/Text/LdaTransform.cs 89.26% <0%> (-0.63%) ⬇️
...soft.ML.Data/DataLoadSave/Text/TextLoaderCursor.cs 84.9% <0%> (+0.2%) ⬆️
...soft.ML.TestFramework/DataPipe/TestDataPipeBase.cs 73.93% <0%> (+0.32%) ⬆️

@codemzs codemzs requested review from TomFinley and eerhardt April 30, 2019 22:22
@codemzs codemzs force-pushed the imagetransformwarnings branch from 1f299ea to 408f4c1 Compare April 30, 2019 22:28
@codemzs codemzs requested review from glebuk and eerhardt May 1, 2019 00:05
@codemzs codemzs changed the title Load images without lock in transformer and print warning messages when converting unsupported pixel format. Print warning messages when converting unsupported pixel format. May 1, 2019
@codemzs codemzs requested review from TomFinley and glebuk May 1, 2019 18:52
@codemzs codemzs changed the title Print warning messages when converting unsupported pixel format. Download images when not present on disk and print warning messages when converting unsupported pixel format. May 1, 2019
@codemzs codemzs changed the title Download images when not present on disk and print warning messages when converting unsupported pixel format. Download images only when not present on disk and print warning messages when converting unsupported pixel format. May 1, 2019
@TomFinley
Copy link
Contributor

TomFinley commented May 1, 2019

                            throw Host.Except($"Image {src.ToString()} was not found.");

Not your code, but there's something a bit odd about it that it assumes that any exception must be due to teh file not being found. #Closed


Refers to: src/Microsoft.ML.ImageAnalytics/ImageLoader.cs:208 in 133fbe1. [](commit_id = 133fbe1, deletion_comment = False)

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, after @TomFinley's comments are addressed.

@codemzs
Copy link
Member Author

codemzs commented May 1, 2019

                            throw Host.Except($"Image {src.ToString()} was not found.");

Seems like the comment above this line explains why the original author wrote like.


In reply to: 488380679 [](ancestors = 488380679)


Refers to: src/Microsoft.ML.ImageAnalytics/ImageLoader.cs:208 in 133fbe1. [](commit_id = 133fbe1, deletion_comment = False)

@codemzs
Copy link
Member Author

codemzs commented May 1, 2019

                            throw Host.Except($"Image {src.ToString()} was not found.");

Spoke offline and we decided the to remove try catch altogether. Right now docs do say on file not found it will throw FileNotFoundException instead of ArgumentException as before..


In reply to: 488396420 [](ancestors = 488396420,488380679)


Refers to: src/Microsoft.ML.ImageAnalytics/ImageLoader.cs:208 in 133fbe1. [](commit_id = 133fbe1, deletion_comment = False)

Copy link
Contributor

@TomFinley TomFinley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @codemzs !

Copy link
Contributor

@glebuk glebuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@codemzs codemzs merged commit d1ff3a4 into dotnet:master May 1, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Mar 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants