Explorar el Código

some fixes in the coordinate re-scaling and default multi-job data loading (using multi-threading as default now)

Dimitri Korsch hace 2 años
padre
commit
8d7cb25ed0
Se han modificado 2 ficheros con 4 adiciones y 1 borrados
  1. 1 1
      cvdatasets/utils/dataset.py
  2. 3 0
      cvdatasets/utils/transforms.py

+ 1 - 1
cvdatasets/utils/dataset.py

@@ -12,7 +12,7 @@ def _uuid_check(uuids):
 		"UUIDs are not unique!"
 
 def new_iterator(data, n_jobs, batch_size, repeat=True, shuffle=True, n_prefetch=2, *,
-	use_threads: bool = False):
+	use_threads: bool = True):
 	from chainer.iterators import SerialIterator, MultiprocessIterator, MultithreadIterator
 
 	it_kwargs = dict(batch_size=batch_size, repeat=repeat, shuffle=shuffle)

+ 3 - 0
cvdatasets/utils/transforms.py

@@ -23,6 +23,9 @@ def dimensions(im):
 def rescale(im, coords, rescale_size, center_cropped=True, no_offset=False):
 	h, w, c = dimensions(im)
 
+	if np.all(coords == -1):
+		return coords
+
 	offset = 0
 	if center_cropped:
 		_min_val = min(w, h)