-
Notifications
You must be signed in to change notification settings - Fork 0
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
Bulk Insert #2
Comments
Hello @Kencho5 Benchmarking source code: ImageMatchNetBenchmark.zip |
i noticed that i was calling the same function in a loop which was slowing down things. does ImageMatchNet have bulk insert or i have to implement that myself? sorry for the trouble |
@Kencho5 Currently there is no bulk insert method. I use the following code for bulk insertion and it doesn't take long var path = Path.Combine(Directory.GetCurrentDirectory(), "images/1.jpg");
var storage = new ElasticsearchSignatureStorage("http://localhost:9200");
var sw = new Stopwatch();
for (int i = 0; i < 1000; i++)
{
var key = Path.GetRandomFileName();
sw.Start();
storage.AddOrUpdateImage(key, path);
sw.Stop();
Console.WriteLine($"Inserted Key:'{key}', Elapsed:{sw.ElapsedMilliseconds}ms");
sw.Restart();
} |
i needed to insert images from urls so i had to make an async function which takes urls, gets image bytes from around 5,000 images, created signature data using your functions from ImageMatchNet, appends those signature data objects to list and bulk inserts into elastic. takes around 4-5 seconds. i can share code if you need it |
Please provide the code that can reproduce the issue |
Hello,
i noticed that there is no function to bulk insert images. i tried making my own and succeeded, but i noticed that making the signature data using MakeSignatureData() function is pretty slow compared to python's image-match module. it took 0.4 seconds on average to generate signature data in python and it takes 1.2 seconds in ImageMatchNet. what could be the case here?
thanks.
The text was updated successfully, but these errors were encountered: