nvjpeg
              
                
                
            
          copied
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			Readme
Files and versions
Updated 3 years ago
image-decode
Image Decode Implementation with CV2 and nvjpeg
author: junjie.jiang
Description
An image decode operator implementation with OpenCV and nvjpeg. In CPU env, use OpenCV, in GPU env, use nvjpeg to decode jpeg files.
Code Example
Load a image from path './src_dog.jpg'.
Write the pipeline in simplified style:
from towhee import pipe, ops, DataCollection
p = (
  pipe.input('url')
  .map('url', 'image', ops.image_decode.nvjpeg())
  .output('image')
)
DataCollection(p('./src_dog.jpg')).show()
Factory Constructor
Create the operator via the following factory method:
ops.image_decode.nvjpeg()
Interface
An image decode operator takes an image path as input. It decodes the image back to ndarray.
Parameters:
img: str
 Local file path or http url.
Returns: towhee.types.Image (a sub-class of numpy.ndarray)
 The decoded image data as numpy.ndarray.
| 
              
                 | 11 Commits | ||
|---|---|---|---|
| 
                
                  
                    
                      
                      
                       | 
              
                3 years ago | ||
| 
                
                  
                    
                      
                      
                       | 
              
                3 years ago | ||
| 
                
                  
                    
                      
                      
                       | 
              
                3 years ago | ||
| 
                
                  
                    
                      
                      
                       | 
              
                3 years ago | ||
| 
                
                  
                    
                      
                      
                       | 
              
                3 years ago | ||
| 
                
                  
                    
                       | 
              
                
                  
                    
											 
												1.1 KiB
											 
                      
                         | 
              
              
              
              3 years ago | |
| 
                
                  
                    
                       | 
              
                
                  
                    
											 
												1.0 KiB
											 
                      
                         | 
              
              
              
              3 years ago | |
| 
                
                  
                    
                       | 
              
                
                  
                    
											 
												726 B
											 
                      
                         | 
              
              
              
              3 years ago | |
| 
                
                  
                    
                       | 
              
                
                  
                    
											 
												26 KiB
											 
                      
                         | 
              
              
              
              3 years ago | |
| 
                
                  
                    
                       | 
              
                
                  
                    
											 
												2.9 KiB
											 
                      
                         | 
              
              
              
              3 years ago | |
| 
                
                  
                    
                       | 
              
                
                  
                    
											 
												29 B
											 
                      
                         | 
              
              
              
              3 years ago | |
| 
                
                  
                    
                       | 
              
                
                  
                    
											 
												26 KiB
											 
                      
                         | 
              
              
              
              3 years ago | |