hiukim / mind-ar-js

Web Augmented Reality. Image Tracking, Face Tracking. Tensorflow.js
MIT License
2.21k stars 413 forks source link

Preload Image Targets? #450

Open valentindiehl opened 1 year ago

valentindiehl commented 1 year ago

Hi there,

first of all: Awesome work and a great project! Just a short question for production use: Is it possible to pre-download the image targets and hand them over through a direct reference or any other way?

Since our app switches from "scan" to another screen quite often, it's suboptimal to have the request every time, even if it's served from cache. It would allow us to show a loading screen before starting the app as we have quite a lot of targets usually (between 100 and 500).

Or does the library use the standard fetch-cache so I could just use a regular fetch command once for the image target URL and mind-ar will read it from cache when the screen is loaded?

Thank's so much in advance!

hiukim commented 8 months ago

the library doesn't provide a method to do that, but it's just a regular file and I suppose you can use whatever ways that apply to a generic web application to do that. I personally don't know the answer.

s-ol commented 2 months ago

It would make sense to open up the API to accept at least a msgpack Buffer directly on the client, if not the decoded JSON directly. This would make it much easier also to assemble ".mind packs" on the client as needed when the set of tracked markers is dynamically changing.

For my use case, it would also be very useful to be able to attach metadata JSON, or at least a custom ID field, to each marker entry in the ".mind" file to be able to identify the marker as it interacts with external systems upon matching, rather than using its index.

I'd be happy to contribute minimally invasive and backwards compatible PRs for these two features, but I see that there has been little activity on PRs recently. @hiukim would you be interested in merging such changes?