Xiangyu-Gao / Radar-multiple-perspective-object-detection

Codes and template data for paper "RAMP-CNN: A Novel Neural Network for Enhanced Automotive Radar Object Recognition"
MIT License
51 stars 18 forks source link

problems with convertFormat.py #15

Open jimvermunt opened 9 months ago

jimvermunt commented 9 months ago

I have adjusted the converFormat.py to automating the task.

if __name__ == "__main__":
    path = './data/Automotive/2019_04_30_mlms001'
    convert(path)
    res = read_ra_labels_csv(path)
    print(len(res))

Changed it to:

if __name__ == "__main__":
    base_path = './data/Automotive'

    # List all directories in the base_path
    all_directories = [d for d in os.listdir(base_path) if os.path.isdir(os.path.join(base_path, d))]

    for directory in all_directories:
        if directory == '2019_04_09_pms2000':
            continue
        full_path = os.path.join(base_path, directory)
        print(full_path)
        convert(full_path)
        res = read_ra_labels_csv(full_path)
        print(f"Directory: {directory}, Length: {len(res)}")

With this I ran into several problems.

jimvermunt commented 9 months ago

In convert_annotation.py: type = release_dataset_label_map[int(line[1])] Throws error: /utils/convert_annotations.py", line 53, in convert type = release_dataset_label_map[int(line[1])] ValueError: invalid literal for int() with base 10: '80.00'

This problem was resolved by replacing the line with the following: type = release_dataset_label_map[int(float(line[1]))]

jimvermunt commented 9 months ago

When adjusting this I get the following KeyError in file 2019_05_09_bm1s007/text_labels/0000000635.csv:

./data/Automotive/2019_05_09_bm1s007/text_labels/0000000635.csv
Traceback (most recent call last):
  File "convertFormat.py", line 30, in <module>
    convert(full_path)
  File "/home/tue/20204239/77ghzradarpipeline/Radar-multiple-perspective-object-detection/utils/convert_annotations.py", line 54, in convert
    type = release_dataset_label_map[int(float(line[1]))]
KeyError: 1

This due that the mapping of 1 does not exist in the map "release_dataset_label_map" in convert_annotations.py.

The file has the following content.

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">

24 | 2 | -0.39 | 16.4 | 4.5 | 1.8 -- | -- | -- | -- | -- | -- 20 | 2 | 4.26 | 10.69 | 1.8 | 4.5 17 | 2 | 5.41 | 7.39 | 1.8 | 4.5 297 | 2 | 5.08 | 5.17 | 1.8 | 4.5 34 | 1 | -4.06 | 3.77 | 0.6 | 1.7

The mapping variable:

release_dataset_label_map = {0: 'person',
                            #  1: 'car',
                             2: 'car',
                             3: 'motorbike',
                             5: 'bus',
                             7: 'truck',
                             80: 'cyclist'}

What does the number 1 represent exactly?

jimvermunt commented 9 months ago

When I map temporarily number 1 to car I get the following error:

./data/Automotive/2019_05_09_mlms003/text_labels/0000000424.csv
Traceback (most recent call last):
  File "convertFormat.py", line 30, in <module>
    convert(full_path)
  File "/home/tue/20204239/77ghzradarpipeline/Radar-multiple-perspective-object-detection/s/convert_annotations.py", line 59, in convert
    angle = math.degrees(math.atan(x / y))  # in degree
ZeroDivisionError: division by zero

I fixed this by setting y on the smallest possible value if it set by 1 changing the code in "convert_annotations.py":

            x = int(float(line[2])) # x cordinate
            y = int(float(line[3])) # y cordinate

into:

            x = int(float(line[2])) # x cordinate
            y = int(float(line[3])) # y cordinate
            if(y ==0):
                y = 1
Xiangyu-Gao commented 9 months ago

When adjusting this I get the following KeyError in file 2019_05_09_bm1s007/text_labels/0000000635.csv:

./data/Automotive/2019_05_09_bm1s007/text_labels/0000000635.csv
Traceback (most recent call last):
  File "convertFormat.py", line 30, in <module>
    convert(full_path)
  File "/home/tue/20204239/77ghzradarpipeline/Radar-multiple-perspective-object-detection/utils/convert_annotations.py", line 54, in convert
    type = release_dataset_label_map[int(float(line[1]))]
KeyError: 1

This due that the mapping of 1 does not exist in the map "release_dataset_label_map" in convert_annotations.py.

The file has the following content.

24 2 -0.39 16.4 4.5 1.8 20 2 4.26 10.69 1.8 4.5 17 2 5.41 7.39 1.8 4.5 297 2 5.08 5.17 1.8 4.5 34 1 -4.06 3.77 0.6 1.7 The mapping variable:

release_dataset_label_map = {0: 'person',
                            #  1: 'car',
                             2: 'car',
                             3: 'motorbike',
                             5: 'bus',
                             7: 'truck',
                             80: 'cyclist'}

What does the number 1 represent exactly?

You may discard the number 1 labeling. It should be the redundant noise label.