diff --git a/cnn_classifier.py b/cnn_classifier.py index 78a54542..0b80453f 100644 --- a/cnn_classifier.py +++ b/cnn_classifier.py @@ -128,7 +128,7 @@ def detect_objects(self, ymax = int(min(imH,(boxes[i][2] * imH))) xmax = int(min(imW,(boxes[i][3] * imW))) - object_name = self._labels[int(classes[i])] + object_name = self._labels[int(classes[i])+1] pairs.append((object_name, int(100*scores[i]), (xmin, ymin, xmax, ymax))) pairs = sorted(pairs, key=lambda x: x[1], reverse=True)[:top_results] diff --git a/cnn_models.tar.xz b/cnn_models.tar.xz new file mode 100644 index 00000000..33cf7f9f Binary files /dev/null and b/cnn_models.tar.xz differ diff --git a/cnn_models/models.json b/cnn_models/models.json index 1318bd0f..47b9b270 100644 --- a/cnn_models/models.json +++ b/cnn_models/models.json @@ -1,26 +1,20 @@ { - "base_high_slow": { - "output_layer": "final_result", - "image_width": 224, - "status": 1, - "image_height": 224 - }, - "base_low_fast": { - "output_layer": "final_result", - "image_width": 224, - "status": 100, - "image_height": 224 - }, - "object_detect": { - "output_layer": "final_result", - "image_width": 224, - "status": 1, - "image_height": 224 - }, - "object_detect_mobile": { - "output_layer": "final_result", - "image_width": 224, - "status": 1, - "image_height": 224 - } -} + "generic_fast_low": { + "status": 1.0, + "image_height": "224", + "image_width": "224", + "output_layer": "" + }, + "generic_slow_high": { + "status": 1.0, + "image_height": "224", + "image_width": "224", + "output_layer": "" + }, + "generic_object_detect": { + "status": 1.0, + "image_height": "224", + "image_width": "224", + "output_layer": "" + } +} \ No newline at end of file diff --git a/coderbot.cfg b/coderbot.cfg index 949bf3a2..5e8264f9 100644 --- a/coderbot.cfg +++ b/coderbot.cfg @@ -1 +1 @@ -{"move_power_angle_3": "60", "cnn_default_model": "generic_fast_low", "prog_maxblocks": "-1", "camera_jpeg_quality": "5", "show_page_control": "true", "camera_framerate": "30", "prog_scrollbars": "true", "move_fw_speed": "100", "prog_level": "adv", "move_motor_trim": "1", "move_motor_mode": "dc", "cv_image_factor": "2", "move_power_angle_1": "45", "camera_path_object_size_min": "4000", "button_func": "none", "camera_color_object_size_min": "4000", "camera_jpeg_bitrate": "1000000", "move_fw_elapse": "1", "show_control_move_commands": "true", "camera_color_object_size_max": "160000", "show_page_prefs": "true", "camera_exposure_mode": "auto", "ctrl_tr_elapse": "-1", "show_page_program": "true", "move_tr_elapse": "0.5", "camera_path_object_size_max": "160000", "sound_shutter": "$shutter.mp3", "ctrl_fw_elapse": "-1", "sound_stop": "$shutdown.mp3", "ctrl_tr_speed": "80", "ctrl_fw_speed": "100", "move_tr_speed": "85", "move_power_angle_2": "60", "ctrl_hud_image": "", "load_at_start": "", "sound_start": "$startup.mp3", "encoder": "True"} \ No newline at end of file +{"move_power_angle_3": "60", "cnn_default_model": "generic_fast_low", "prog_maxblocks": "-1", "camera_jpeg_quality": "5", "show_page_control": "true", "camera_framerate": "30", "prog_scrollbars": "true", "move_fw_speed": "100", "prog_level": "adv", "move_motor_trim": "1", "move_motor_mode": "dc", "cv_image_factor": "2", "move_power_angle_1": "45", "camera_path_object_size_min": "4000", "button_func": "none", "camera_color_object_size_min": "4000", "camera_jpeg_bitrate": "1000000", "move_fw_elapse": "1", "show_control_move_commands": "true", "camera_color_object_size_max": "160000", "show_page_prefs": "true", "camera_exposure_mode": "auto", "ctrl_tr_elapse": "-1", "show_page_program": "true", "move_tr_elapse": "0.5", "camera_path_object_size_max": "160000", "sound_shutter": "$shutter.mp3", "ctrl_fw_elapse": "-1", "sound_stop": "$shutdown.mp3", "ctrl_tr_speed": "80", "ctrl_fw_speed": "100", "move_tr_speed": "85", "move_power_angle_2": "60", "ctrl_hud_image": "", "load_at_start": "", "sound_start": "$startup.mp3", "encoder": "True", "wifi_mode": "ap", "wifi_ssid": "", "wifi_psk": ""} \ No newline at end of file diff --git a/data/defaults/programs/program_test_sonars.json b/data/defaults/programs/program_test_sonars.json new file mode 100644 index 00000000..df0c0493 --- /dev/null +++ b/data/defaults/programs/program_test_sonars.json @@ -0,0 +1 @@ +{"name": "test_sonars", "dom_code": "WHILETRUEFront: 0 Right: 1 Left: 2", "code": "while True:\n get_prog_eng().check_end()\n get_cam().set_text(''.join([str(x) for x in ['Front: ', get_bot().get_sonar_distance(0), ' Right: ', get_bot().get_sonar_distance(1), ' Left: ', get_bot().get_sonar_distance(2)]]))\n", "default": false} \ No newline at end of file diff --git a/data/programs.json b/data/programs.json index dad1042e..4e899519 100644 --- a/data/programs.json +++ b/data/programs.json @@ -1 +1 @@ -{"_default": {"1": {"name": "test_find_code", "filename": "./data/defaults/programs/program_test_find_code.json", "default": "True"}, "2": {"name": "demo_color_seeker", "filename": "./data/defaults/programs/program_demo_color_seeker.json", "default": "True"}, "3": {"name": "demo_sound_clap_control", "filename": "./data/defaults/programs/program_demo_sound_clap_control.json", "default": "True"}, "4": {"name": "test_find_path_ahead", "filename": "./data/defaults/programs/program_test_find_path_ahead.json", "default": "True"}, "5": {"name": "test_sound_hear", "filename": "./data/defaults/programs/program_test_sound_hear.json", "default": "True"}, "6": {"name": "test_find_color", "filename": "./data/defaults/programs/program_test_find_color.json", "default": "True"}, "7": {"name": "test_cnn_classifier", "filename": "./data/defaults/programs/program_test_cnn_classifier.json", "default": "True"}, "8": {"name": "test_sound_rec", "filename": "./data/defaults/programs/program_test_sound_rec.json", "default": "True"}, "9": {"name": "test_find_face", "filename": "./data/defaults/programs/program_test_find_face.json", "default": "True"}, "10": {"name": "demo_obstacle_avoidance", "filename": "./data/defaults/programs/program_demo_obstacle_avoidance.json", "default": "True"}, "11": {"name": "test_img_average", "filename": "./data/defaults/programs/program_test_img_average.json", "default": "True"}, "12": {"name": "demo_ar_tags", "filename": "./data/defaults/programs/program_demo_ar_tags.json", "default": "True"}, "13": {"name": "test_cnn_object_detect", "filename": "./data/defaults/programs/program_test_cnn_object_detect.json", "default": "True"}, "14": {"name": "demo_line_follower", "filename": "./data/defaults/programs/program_demo_line_follower.json", "default": "True"}}} \ No newline at end of file +{"_default": {"1": {"name": "test_find_code", "filename": "./data/defaults/programs/program_test_find_code.json", "default": "True"}, "2": {"name": "demo_color_seeker", "filename": "./data/defaults/programs/program_demo_color_seeker.json", "default": "True"}, "3": {"name": "demo_sound_clap_control", "filename": "./data/defaults/programs/program_demo_sound_clap_control.json", "default": "True"}, "4": {"name": "test_find_path_ahead", "filename": "./data/defaults/programs/program_test_find_path_ahead.json", "default": "True"}, "5": {"name": "test_sound_hear", "filename": "./data/defaults/programs/program_test_sound_hear.json", "default": "True"}, "6": {"name": "test_find_color", "filename": "./data/defaults/programs/program_test_find_color.json", "default": "True"}, "7": {"name": "test_cnn_classifier", "filename": "./data/defaults/programs/program_test_cnn_classifier.json", "default": "True"}, "8": {"name": "test_sound_rec", "filename": "./data/defaults/programs/program_test_sound_rec.json", "default": "True"}, "9": {"name": "test_find_face", "filename": "./data/defaults/programs/program_test_find_face.json", "default": "True"}, "10": {"name": "demo_obstacle_avoidance", "filename": "./data/defaults/programs/program_demo_obstacle_avoidance.json", "default": "True"}, "11": {"name": "test_sonars", "filename": "./data/defaults/programs/program_test_sonars.json", "default": "True"}, "12": {"name": "test_img_average", "filename": "./data/defaults/programs/program_test_img_average.json", "default": "True"}, "13": {"name": "demo_ar_tags", "filename": "./data/defaults/programs/program_demo_ar_tags.json", "default": "True"}, "14": {"name": "test_cnn_object_detect", "filename": "./data/defaults/programs/program_test_cnn_object_detect.json", "default": "True"}, "15": {"name": "demo_line_follower", "filename": "./data/defaults/programs/program_demo_line_follower.json", "default": "True"}}} \ No newline at end of file