This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Optimize the safety model | |
python3 /opt/intel/openvino/deployment_tools/tools/model_optimizer/mo_caffe.py --input_model <path to caffemodel file> --input_proto <path to prototxt file> -o <specify the output directory> | |
#Optimize the mask model | |
python3 /opt/intel/openvino/deployment_tools/tools/model_optimizer/mo_caffe.py --input_model <path to caffemodel file> --input_proto <path to prototxt file> -o <specify the output directory> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Navigate to the model downloader directory and download the models | |
#Download the person detection model | |
python3 /opt/intel/openvino/deployment_tools/tools/model_downloader/downloader.py --name "person-detection-retail-0013" | |
#Download the face detection model | |
python /opt/intel/openvino/deployment_tools/tools/model_downloader/downloader.py --name "face-detection-adas-binary-0001" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "tensorflow/lite/micro/examples/micro_speech/main_functions.h" | |
#include "tensorflow/lite/micro/examples/micro_speech/audio_provider.h" | |
#include "tensorflow/lite/micro/examples/micro_speech/command_responder.h" | |
#include "tensorflow/lite/micro/examples/micro_speech/feature_provider.h" | |
#include "tensorflow/lite/micro/examples/micro_speech/micro_features/micro_model_settings.h" | |
#include "tensorflow/lite/micro/examples/micro_speech/micro_features/model.h" | |
#include "tensorflow/lite/micro/examples/micro_speech/recognize_commands.h" | |
#include "tensorflow/lite/micro/kernels/micro_ops.h" | |
#include "tensorflow/lite/micro/micro_error_reporter.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "tensorflow/lite/micro/examples/micro_speech/micro_features/micro_model_settings.h" | |
const char* kCategoryLabels[kCategoryCount] = { | |
"silence", | |
"unknown", | |
"yes", | |
"no", | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "tensorflow/lite/micro/examples/micro_speech/micro_features/model.h" | |
// We need to keep the data array aligned on some architectures. | |
#ifdef __has_attribute | |
#define HAVE_ATTRIBUTE(x) __has_attribute(x) | |
#else | |
#define HAVE_ATTRIBUTE(x) 0 | |
#endif | |
#if HAVE_ATTRIBUTE(aligned) || (defined(__GNUC__) && !defined(__clang__)) | |
#define DATA_ALIGN_ATTRIBUTE __attribute__((aligned(4))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stages: | |
ELT: | |
cmd: python src/data_preprocessor.py -s train test valid -o "./data_store/data/American | |
Sign Language Letters.v1-v1.tfrecord" | |
deps: | |
- src/data_preprocessor.py | |
outs: | |
- ./data_store/data/American Sign Language Letters.v1-v1.tfrecord | |
feature_tranform-train: | |
cmd: python src/train.py -dt True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
labels = train_dataset_version.list_labels() | |
label_names = [label.name for label in labels] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def coco_format_loader(train_dataset_version, label_names, coco_annotations_path): | |
coco_annotation = train_dataset_version.build_coco_file_locally( | |
enforced_ordered_categories=label_names | |
) | |
annotations_dict = coco_annotation.dict() | |
with open(coco_annotations_path, "w") as f: | |
f.write(json.dumps(annotations_dict)) | |
annotations_coco = COCO(coco_annotations_path) | |
return annotations_coco |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cats = annotations_coco.cats | |
id2label = {str(k): v['name'] for k,v in cats.items()} | |
label2id = {v: k for k, v in id2label.items()} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# log dataset labels to the picsellia experiment | |
experiment.log("labelmap", id2label, type= LogType.TABLE, replace=True) |
OlderNewer