class documentation
class ProcessMapper(fomm.LocalMapper): (source)
Constructor: ProcessMapper(batch_cls, num_workers, batch_size)
Executes map_samples using multiprocessing.
Class Method | create |
Create a new mapper instance |
Method | _map |
of the results. |
Inherited from LocalMapper
:
Method | _map |
of the results. |
Inherited from Mapper
(via LocalMapper
):
Method | __init__ |
Undocumented |
Method | map |
Applies map function to each sample and returns an iterator of the results. |
Property | batch |
Number of samples per worker batch |
Property | num |
Number of workers to use |
Static Method | _handle |
Common error handling when a map error occurs |
Instance Variable | _batch |
Undocumented |
Instance Variable | _batch |
Undocumented |
Instance Variable | _num |
Undocumented |
@classmethod
def create(cls, *, config:
def create(cls, *, config:
focc.FiftyOneConfig
, batch_cls: type[ fomb.SampleBatch]
, num_workers: int | None
= None, batch_size: int | None
= None, **__):
(source)
¶
overrides
fiftyone.core.map.mapper.Mapper.create
Create a new mapper instance
def _map_samples_multiple_workers(self, sample_collection:
SampleCollection[ T]
, map_fcn: Callable[ [ T], R]
, *, progress: bool | Literal[ 'workers'] | None
, save: bool
, skip_failures: bool
) -> Iterator[ tuple[ bson.ObjectId, R]]
:
(source)
¶
- Applies map function to each sample batch and returns an iterator
- of the results.
Parameters | |
sampleSampleCollection[T] | The sample collection to map. |
mapCallable[[T] , R] | The map function to apply to each sample. |
progress:Union[bool , Literal[ "workers"]] | Whether or not and how to render progress. |
save:bool , optional | Whether to save mutated samples mutated in the map function. Defaults to False. |
skipbool , optional | Whether to gracefully continue without raising an error if the map function raises an exception for a sample. Defaults to True. |
Returns | |
Iterator[ | Undocumented |
Yields | |
MapSampleBatchesReturnType |
|