Skip to content

opencv.js : expose FS#15319

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
cancerberoSgx:fs
Nov 8, 2019
Merged

opencv.js : expose FS#15319
opencv-pushbot merged 1 commit intoopencv:3.4from
cancerberoSgx:fs

Conversation

@cancerberoSgx
Copy link
Copy Markdown
Contributor

@cancerberoSgx cancerberoSgx commented Aug 16, 2019

expose FS in Module.FS so users can use the filesystem. This gives more flexibility and enable C/C++ APIs that reference files. Also needed for supporting node.js and load images directly from local filesystem. (i'm working on supporting node.js too)

relates #15425

@alalek
Copy link
Copy Markdown
Member

alalek commented Aug 19, 2019

Could you please add some usage example (tutorial code) how to use this patch?

@cancerberoSgx
Copy link
Copy Markdown
Contributor Author

@alalek I added an example here https://github.com/opencv/opencv/pull/15425/files#diff-73a1e2abb8562d484104b42b05a03fafR306 that makes extensive use of FS

However this not only applies to Node.js - accessing FS makes sense in lots of use cases also in the browser. mostly for loading data files for models. I think there's no tutorial that explain how to do this - in tutorials that load data files , the JS code that do that is not present in the code snippet so the user needs to go to the html source itself in order to realize how to do it.

I could modify one of these tutorials html like https://docs.opencv.org/master/d2/d99/tutorial_js_face_detection.html and include the code that loads the data file

Or alternative make a new tutorial about this in particular.

What do you think?

@asmorkalov asmorkalov self-requested a review October 14, 2019 09:00
@asmorkalov
Copy link
Copy Markdown
Contributor

@cancerberoSgx As fo me, some dedicated example for FS is better than Face Detection modification.

@asmorkalov
Copy link
Copy Markdown
Contributor

@cancerberoSgx Just a friendly reminder. Do you plan to work on example in scope of the PR?

@asmorkalov
Copy link
Copy Markdown
Contributor

👍

@alalek
Copy link
Copy Markdown
Member

alalek commented Nov 6, 2019

This patch should go into 3.4 branch first. We will merge changes from 3.4 into master regularly (weekly/bi-weekly).

So, please:

  • change "base" branch of this PR: master => 3.4 (use "Edit" button near PR title)
  • rebase your commits from master onto 3.4 branch. For example:
    git rebase -i --onto upstream/3.4 upstream/master
    (check list of your commits, save and quit (Esc + "wq" + Enter)
    where upstream is configured by following this GitHub guide and fetched (git fetch upstream).
  • push rebased commits into source branch of your fork (with --force option)

Note: no needs to re-open PR, apply changes "inplace".

opencv-pushbot pushed a commit that referenced this pull request Nov 8, 2019
@opencv-pushbot opencv-pushbot merged commit dd9262c into opencv:3.4 Nov 8, 2019
@alalek alalek mentioned this pull request Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants