-
Notifications
You must be signed in to change notification settings - Fork 7.1k
C++ Caltech Dataset #1121
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
C++ Caltech Dataset #1121
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1121 +/- ##
=======================================
Coverage 65.78% 65.78%
=======================================
Files 79 79
Lines 5834 5834
Branches 887 887
=======================================
Hits 3838 3838
Misses 1726 1726
Partials 270 270 Continue to review full report at Codecov.
|
Hi @ShahriarSS Thanks for the PR! Here are some initial thoughts: Use of OpenCV:The C++ models that we have are compatible with the Python models. OpenCV return the images in a different format than what we generally use (BGR in 0-255, instead of RGB in 0-1). I'm currently reworking the transforms to also accept PyTorch tensors. This means that we could also do the same thing in C++, and use torch ops for rescaling / etc. The question now is to have a basic read-image function that is compatible with the rest of the codebase. Also, can we make the API of the methods require OpenCV? For example, we should avoid passing and returning What about the following: Could you split this PR into two components:
Filesystem accessWe have a large user-base of Windows users, and it might be worth considering if we want to add support for Windows right in the beginning or not. I'm ccing @soumith on this Download inside datasetsI don't think this is a requirement for now. TestsIdeally we would use the same Python functions that create fake datasets, save them to disk and read with the C++ frontend to verify that everything works as expected. |
Thanks @ShahriarSS for this contribution and sorry for the late reply. The datasets API is being rewritten into a new API as described here. Not yet sure if it includes C++ datasets (or if it is planned) as well but I suppose it does for now (or will shortly). @pmeier is there a I would suggest the following:
What do you think @ShahriarSS about that? Feel free to ask additional questions, thanks! |
There are no plans to have C++ wrappers for the datasets. Looking at this PR, the data reading, i.e. image decoding part in C++, is already implemented in Given that this PR is stale for ~3 years, I'll close this for now. @ShahriarSS if there is still need for the C++ dataset wrappers, would you mind opening an issue? |
Description:
C++17
has filesystem but since we are usingC++11
I had to write it with system calls and since I don't have a working windows environment I have only writtenPOSIX
side (doesn't work on windows but works fine on others).OpenCV
. Python models take in a transform function that does some operations on a PILL image. I have written a similar function that takes acv::Mat
and returns the matrix after doing operations on it. there are some default transform functions in the namespacecv_transforms
that convert image to rgb or grayscale and resize to 224x224.Caltech101
dataset. If we agree on the structure I can write the rest.C++
. We can use a library likeboost
or others. Or we can write one from scratch with socket programming. Or we can call python functions (which I don't think is a good idea) (haven't decided yet).global.h
up to include it in datasets too.C++
and usegtest
(haven't decided yet).