Skip to content
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

Add Image support #6

Merged
merged 70 commits into from Jul 16, 2020
Merged

Add Image support #6

merged 70 commits into from Jul 16, 2020

Conversation

jeffin143
Copy link
Member

No description provided.

@jeffin143 jeffin143 marked this pull request as ready for review June 16, 2020 05:42
@jeffin143 jeffin143 requested review from toshal-a and birm June 16, 2020 05:42
Copy link
Collaborator

@toshal-a toshal-a left a comment

Choose a reason for hiding this comment

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

I was just going through the changes. left some comments.

README.md Outdated Show resolved Hide resolved
examples/image.md Outdated Show resolved Hide resolved
examples/image.md Outdated Show resolved Hide resolved
examples/image.md Outdated Show resolved Hide resolved
examples/image.md Outdated Show resolved Hide resolved
include/filewriter/util_impl.hpp Outdated Show resolved Hide resolved
include/filewriter/summarywriter.hpp Outdated Show resolved Hide resolved
Co-authored-by: Toshal Agrawal <37237262+walragatver@users.noreply.github.com>
Copy link
Member

@birm birm left a comment

Choose a reason for hiding this comment

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

This should mostly fix the style build. You may also want to remove the ending space at filewriter line 87

include/filewriter/summarywriter.hpp Outdated Show resolved Hide resolved
include/filewriter/summarywriter_impl.hpp Outdated Show resolved Hide resolved
include/filewriter/summarywriter_impl.hpp Outdated Show resolved Hide resolved
include/filewriter/summarywriter_impl.hpp Outdated Show resolved Hide resolved
include/filewriter/summarywriter_impl.hpp Outdated Show resolved Hide resolved
include/filewriter/summarywriter_impl.hpp Outdated Show resolved Hide resolved
include/filewriter/summarywriter_impl.hpp Outdated Show resolved Hide resolved
include/filewriter/summarywriter_impl.hpp Outdated Show resolved Hide resolved
.ci/linux-steps.yaml Outdated Show resolved Hide resolved
examples/image.md Outdated Show resolved Hide resolved
examples/image.md Outdated Show resolved Hide resolved
examples/image.md Outdated Show resolved Hide resolved
examples/image.md Outdated Show resolved Hide resolved
examples/image.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@toshal-a toshal-a left a comment

Choose a reason for hiding this comment

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

Hey this is not a complete review but slightly an important change.

.ci/linux-steps.yaml Outdated Show resolved Hide resolved
.ci/linux-steps.yaml Outdated Show resolved Hide resolved
@birm birm self-requested a review June 22, 2020 16:06
Copy link
Member

@zoq zoq left a comment

Choose a reason for hiding this comment

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

Are you planning to write a test for the image support as well, or perhaps the mlpack test is good enough?

Copy link
Member

@birm birm left a comment

Choose a reason for hiding this comment

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

I didn't get through it entirely before changes started coming in, but here are some observations:

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
examples/getting-started.md Outdated Show resolved Hide resolved
examples/getting-started.md Outdated Show resolved Hide resolved
examples/getting-started.md Outdated Show resolved Hide resolved
examples/image.md Outdated Show resolved Hide resolved
examples/image.md Outdated Show resolved Hide resolved
examples/image.md Outdated Show resolved Hide resolved
examples/image.md Outdated Show resolved Hide resolved
examples/image.md Outdated Show resolved Hide resolved
jeffin143 and others added 2 commits June 23, 2020 19:59
Co-authored-by: Ryan Birmingham <birm@rbirm.us>
@jeffin143 jeffin143 requested review from birm and toshal-a June 23, 2020 16:20
Copy link
Collaborator

@toshal-a toshal-a left a comment

Choose a reason for hiding this comment

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

Hey I have left some comments.

examples/image.md Outdated Show resolved Hide resolved
examples/scaler.md Outdated Show resolved Hide resolved
examples/image.md Outdated Show resolved Hide resolved
start = std::chrono::system_clock::now();
FileWriter f1("temp");

ifstream fin("test_image.png", ios::binary);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's better to add this image in the examples/assets folder. Let me know what you think.

Copy link
Member Author

@jeffin143 jeffin143 left a comment

Choose a reason for hiding this comment

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

Ignore the styling error, I will fix it

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
examples/getting-started.md Outdated Show resolved Hide resolved
examples/getting-started.md Outdated Show resolved Hide resolved
examples/image.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@toshal-a toshal-a left a comment

Choose a reason for hiding this comment

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

Hi, I have left some comments.

tests/util_test.cpp Outdated Show resolved Hide resolved
tests/summarywriter_test.cpp Outdated Show resolved Hide resolved
tests/summarywriter_test.cpp Outdated Show resolved Hide resolved
CMake/CXX11.cmake Outdated Show resolved Hide resolved
examples/scaler.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@toshal-a toshal-a left a comment

Choose a reason for hiding this comment

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

Hi @jeffin143,
The PR looks good now except the slowness of logging arma::mat. I think let's handle its optimization in different PR. I will open an issue for it after merging this PR.
I have left some comments. Let me know what you think.

.ci/windows-steps.yaml Show resolved Hide resolved
CMake/ARMA_FindACML.cmake Outdated Show resolved Hide resolved
CMake/ARMA_FindACMLMP.cmake Outdated Show resolved Hide resolved
CMake/ARMA_FindBLAS.cmake Outdated Show resolved Hide resolved
CMake/ARMA_FindCBLAS.cmake Outdated Show resolved Hide resolved
examples/image.md Outdated Show resolved Hide resolved
tests/CMakeLists.txt Show resolved Hide resolved
tests/filewriter_test.cpp Outdated Show resolved Hide resolved
include/filewriter/filewriter_impl.hpp Show resolved Hide resolved
}
while ((entry = readdir(dir)) != NULL)
{
if (entry->d_name != "." && entry->d_name != ".."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey I think it's better we remove _preprocess directory after every image logging is done. It would help in less diskusage of user. Let me know what you think.

Copy link
Member Author

Choose a reason for hiding this comment

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

Umm, the directory would be empty, so i think it is ok, I think so if it is outside the we can use it for other purpose too , and be sure that all the files are deleted and won't face the issue which we were facing when you ported this function outside the test to main file

Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesn't remove the directory in my os. But let's keep it for now.

@Yashwants19
Copy link
Member

Hi @jeffin143, I am not sure, but should we also take care of OPENMP flag here? As you can see this warning, which is due to mlpack is compiling with -fopenmp and mlboard is not. Kindly let me know what you think?

Copy link
Collaborator

@toshal-a toshal-a left a comment

Choose a reason for hiding this comment

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

Hi @jeffin143, I would just you to handle the OpenMP warning in a different PR. As it's a warning we can tackle it afterward. Let's not hold this PR from merging because of the error generated while handling a warning. Also, This probably would be the last review.

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
examples/getting-started.md Outdated Show resolved Hide resolved
examples/getting-started.md Outdated Show resolved Hide resolved
include/filewriter/summarywriter_impl.hpp Outdated Show resolved Hide resolved
include/filewriter/summarywriter.hpp Show resolved Hide resolved
tests/main.cpp Outdated Show resolved Hide resolved
tests/util_test.cpp Outdated Show resolved Hide resolved
tests/filewriter_test.cpp Show resolved Hide resolved
jeffin143 and others added 2 commits July 15, 2020 02:07
Co-authored-by: Toshal Agrawal <37237262+walragatver@users.noreply.github.com>
@birm birm self-requested a review July 14, 2020 21:22
Copy link
Member

@birm birm left a comment

Choose a reason for hiding this comment

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

From my end, the only thing left of my comments is some instances of "scaler" as opposed to "scalar" remain. I don't think that's intentional, but if it is, then I'll take your word for it.

@jeffin143
Copy link
Member Author

From my end, the only thing left of my comments is some instances of "scaler" as opposed to "scalar" remain. I don't think that's intentional, but if it is, then I'll take your word for it.

Done, That was a typo mistake

@birm
Copy link
Member

birm commented Jul 15, 2020

I think you missed moving "examples/scaler.md" to "examples/scalar.md"

Copy link
Collaborator

@toshal-a toshal-a left a comment

Choose a reason for hiding this comment

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

Hey @jeffin143, I have left some comments. I am having some doubts about the image support. Please let me know your thoughts about it.

README.md Outdated Show resolved Hide resolved
examples/getting-started.md Show resolved Hide resolved
examples/image.md Outdated Show resolved Hide resolved
examples/scalar.md Outdated Show resolved Hide resolved
examples/image.md Outdated Show resolved Hide resolved
examples/image.md Outdated Show resolved Hide resolved
ss.str("");
fin.close();
mlboard::SummaryWriter<mlboard::FileWriter>::Image(
"Test Image", 1, encodedImages, 512, 512, f1, "Sample Image",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey, 512 and 512 is the size of the input image? Or it is of the image which will get displayed in the dashboard? I saw the assets folder the image dimensions are quite different.

Copy link
Member Author

Choose a reason for hiding this comment

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

it is of the image which will get displayed in the dashboard, Currently you can give 0,0 also it doesn't make a difference, It will only make a difference I think so from next release because currently tensor board ignores those values, I have no clue why

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay, If I am not wrong. You are only retrieving the height and width of the image from the imageInfoobject. I think it's better we remove the use of ImageInfo from the API because the user can also enter the height and width manually. Let me know what you think.

Copy link
Member Author

Choose a reason for hiding this comment

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

mlpack::data::Save(fileNames, matrix, info, false);

This line uses it, we need the channels to save it and then while reading it back we need not need it

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh yeah, Thanks for the info. That line got overlooked.

include/filewriter/summarywriter.hpp Outdated Show resolved Hide resolved
include/filewriter/summarywriter.hpp Outdated Show resolved Hide resolved
Co-authored-by: Toshal Agrawal <37237262+walragatver@users.noreply.github.com>
Copy link
Collaborator

@toshal-a toshal-a left a comment

Choose a reason for hiding this comment

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

This PR looks good to me now. There are couple of issues which we need to tackle but I think we can do it in different and according to time. I will create some issues for them. So that we don't forget about it.

@toshal-a toshal-a merged commit db23622 into mlpack:master Jul 16, 2020
@jeffin143 jeffin143 deleted the image-support branch July 16, 2020 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants