question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Batch mode for large number of text labels

See original GitHub issue

Running this code snippet:

import sys, itertools, vedo
from numpy.core.multiarray import arange
from time import perf_counter
from vedo import Picture, Text3D

pic = Picture('lena.bmp')
mesh = pic.tomesh().mapPointsToCells()
labels = []
t0 = perf_counter()

for x, y in itertools.product(arange(0.3, 99, 1), arange(0.4, 99, 1)):
  labels.append(Text3D('42', (x, y, 0), s=0.2))

t1 = perf_counter()
print(f'{t1-t0:.6f}s')
vedo.show(mesh, labels)

takes 3.7s to construct all text labels. 10K labels makes zoom a bit laggy on my PC. 1K labels take 0.5s to create and zoom is very smooth. Is there a way. e.g. batch mode, to create these labels faster and perhaps make display smoother?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
marcomusycommented, Jan 7, 2022

Consider this variation:

...
for x, y in itertools.product(arange(0.3, 99, 1), arange(0.4, 99, 1)):
  labels.append(Text3D('42', (x, y, 0), s=0.2))
labels = vedo.merge(labels) # this merges them into a single object
labels.write("mylabels.ply") # this saves them so you don't need to recreate
# labels = vedo.Mesh("mylabels.ply", c='black')

should solve both problems.

1reaction
pauljurczakcommented, Jan 8, 2022

Fantastic! I will do a few experiments with it. Thanks a lot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Large-scale text categorization by batch mode active learning
In this paper, we present a novel active learning algorithm that selects a batch of text documents for labeling manually in each iteration....
Read more >
Large-scale text categorization by batch mode active learning
In this paper, we present a novel active learning algorithm that selects a batch of text documents for labeling manually in each iteration....
Read more >
Large-Scale Text Categorization by Batch ... - InK@SMU.edu.sg
novel active learning algorithm that selects a batch of text documents for labeling manually in each iteration. The key of the batch mode...
Read more >
Create a batch - Labelbox Docs
To send a batch of data to a project for labeling, use the following steps: Go to the Catalog and filter for the...
Read more >
Large Number of Value Labels - Fast Way - SPSS - YouTube
I demonstrate an efficient way to add a large number of value labels to a variable in SPSS.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found