Skip to content
  • Glenn Jocher's avatar
    Add Hub results.pandas() method (#2725) · c03d5903
    Glenn Jocher authored
    * Add Hub results.pandas() method
    
    New method converts results from torch tensors to pandas DataFrames with column names.
    
    This PR may partially resolve issue https://github.com/ultralytics/yolov5/issues/2703
    
    ```python
    results = model(imgs)
    
    print(results.pandas().xyxy[0])
             xmin        ymin        xmax        ymax  confidence  class    name
    0   57.068970  391.770599  241.383545  905.797852    0.868964      0  person
    1  667.661255  399.303589  810.000000  881.396667    0.851888      0  person
    2  222.878387  414.774231  343.804474  857.825073    0.838376      0  person
    3    4.205386  234.447678  803.739136  750.023376    0.658006      5     bus
    4    0.000000  550.596008   76.681190  878.669922    0.450596      0  person
    ```
    
    * Update comments 
    
    torch example input now shown resized to size=640 and also now a multiple of P6 stride 64 (see https://github.com/ultralytics/yolov5/issues/2722#issuecomment-814785930)
    
    * apply decorators
    
    * PEP8
    
    * Update common.py
    
    * pd.options.display.max_columns = 10
    
    * Update common.py
    c03d5903