concurrent_inference
concurrent_inference copied to clipboard
An example of how to use the multiprocessing package along with PyTorch.
concurrent_inference
An example of how to use the multiprocessing
package along with PyTorch.
Code pertaining to this Medium post.
What does it do?
- A processes [R] reads images from a folder [Fo] and multiple detection processes [D#] are used to obtain the class wise count of objects in the images and write it to a file [Fi].
- It uses
torch.multiprocessing
for multiprocessing,PIL.Image
to read the images andtqdm
to keep track of the queue.
Usage
- Basic usage :
$ python count_objects.py -f input_folder -o output_file.log
- For other options :
$ python count_objects.py -h