EscVM / OIDv4_ToolKit

Download and visualize single or multiple classes from the huge Open Images v4 dataset
GNU General Public License v3.0
809 stars 635 forks source link

IndexError: index 0 is out of bounds for axis 0 with size 0 #51

Closed glenn-jocher closed 5 years ago

glenn-jocher commented 5 years ago
Glenns-iMac:OIDv4_ToolKit glennjocher$ python3 main.py downloader --classes knife kitchen_knife --type_csv train

                   ___   _____  ______            _    _    
                 .'   `.|_   _||_   _ `.         | |  | |   
                /  .-.  \ | |    | | `. \ _   __ | |__| |_  
                | |   | | | |    | |  | |[ \ [  ]|____   _| 
                \  `-'  /_| |_  _| |_.' / \ \/ /     _| |_  
                 `.___.'|_____||______.'   \__/     |_____|

             _____                    _                 _             
            (____ \                  | |               | |            
             _   \ \ ___  _ _ _ ____ | | ___   ____  _ | | ____  ____ 
            | |   | / _ \| | | |  _ \| |/ _ \ / _  |/ || |/ _  )/ ___)
            | |__/ / |_| | | | | | | | | |_| ( ( | ( (_| ( (/ /| |    
            |_____/ \___/ \____|_| |_|_|\___/ \_||_|\____|\____)_|    

    [INFO] | Downloading knife.
   [ERROR] | Missing the class-descriptions-boxable.csv file.
[DOWNLOAD] | Do you want to download the missing file? [Y/n] Y
...145%, 0 MB, 9540 KB/s, 0 seconds passed
[DOWNLOAD] | File class-descriptions-boxable.csv downloaded into OID/csv_folder/class-descriptions-boxable.csv.
Traceback (most recent call last):
  File "main.py", line 37, in <module>
    bounding_boxes_images(args, DEFAULT_OID_DIR)
  File "/Users/glennjocher/PycharmProjects/OIDv4_ToolKit/modules/bounding_boxes.py", line 56, in bounding_boxes_images
    class_code = df_classes.loc[df_classes[1] == class_name].values[0][0]
IndexError: index 0 is out of bounds for axis 0 with size 0
RatarovDaniil commented 5 years ago

Hi @glenn-jocher , I have experienced the same issue. It seems to be that README is wrong. They have this note: "for classes that are composed by different words please use the _ character instead of the space (only for the inline use of the argument --classes). Example: Polar_bear." But in fact df_classes object contains classes without underscore. So, I resolve it just deleting underscore while downloading (e.g. 'Polar bear' in classes.txt).
Best regards, Daniil

keldrom commented 5 years ago

The toolkit woll delete the _ and replace it with a blank space