๐งโ๐ผ
This file contains hidden or 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
| You are Lyra, a master-level AI prompt optimization specialist. Your mission: transform any user input into | |
| precision-crafted prompts that unlock AI's full potential across all platforms. | |
| ## THE 4-D METHODOLOGY | |
| ### 1. DECONSTRUCT | |
| - Extract core intent, key entities, and context | |
| - Identify output requirements and constraints | |
| - Map what's provided vs. what's missing |
This file contains hidden or 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
| docker run -it --rm tensorflow/tensorflow:latest-devel-py3 bash |
This file contains hidden or 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
| # Copy your Tensorflow Lite model file | |
| cp $OUTPUT_DIR/detect.tflite ./ObjectDetection/Model/ | |
| # Update label file | |
| cat << until_it_ends | sudo tee ./ObjectDetection/Model/labelmap.txt | |
| Blouse | |
| Shorts | |
| Skirt | |
| Sweater | |
| Tank |
This file contains hidden or 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
| # Install Protobuf (find release for your system - https://github.com/protocolbuffers/protobuf/releases) | |
| cd $PROJECT_DIR/tf-models/research/ | |
| curl -L https://github.com/protocolbuffers/protobuf/releases/download/v3.9.2/protoc-3.9.2-osx-x86_64.zip -o protobuf.zip | |
| unzip ./protobuf.zip | |
| rm ./protobuf.zip | |
| ./bin/protoc object_detection/protos/*.proto --python_out=. |
This file contains hidden or 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
| export PROJECT_DIR=<YOUR PROJECT DIRECTORY> | |
| # Install COCO API | |
| cd $PROJECT_DIR/tf-models | |
| git clone https://github.com/cocodataset/cocoapi.git | |
| cd cocoapi/PythonAPI | |
| make | |
| # If there is error, try to specify using python3 as below | |
| # python3 setup.py build_ext install |
This file contains hidden or 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
| # Install example app from tensorflow | |
| cd <YOUR WORKSPACE> | |
| git clone https://github.com/tensorflow/examples | |
| # Install cocoapods if first time | |
| sudo gem install cocoapods | |
| # Install pods | |
| cd examples/lite/examples/object_detection/ios/ | |
| pod install |
This file contains hidden or 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
| # Convert TensorFlow graphs into TensorFlow Lite graphs | |
| # Clone tensorflow repo (can be in your workspace) | |
| git clone --recurse-submodules https://github.com/tensorflow/tensorflow.git | |
| cd tensorflow | |
| bazel run -c opt tensorflow/lite/toco:toco -- \ | |
| --input_file=$OUTPUT_DIR/tflite_graph.pb \ | |
| --output_file=$OUTPUT_DIR/detect.tflite \ | |
| --input_shapes=1,300,300,3 \ | |
| --input_arrays=normalized_input_image_tensor \ |
This file contains hidden or 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
| # Install Bazel macOS | |
| # Other systems see: https://docs.bazel.build/versions/master/install.html | |
| /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| brew tap bazelbuild/tap | |
| brew install bazelbuild/tap/bazel | |
| # Check bazel version | |
| bazel --version |
This file contains hidden or 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
| export PROJECT_DIR=<YOUR PROJECT DIRECTORY> | |
| export MODEL_DIR=$PROJECT_DIR/models/<YOUR SSD MODEL> | |
| export TF_API_DIR=$PROJECT_DIR/tf-models/research | |
| export MODEL_CONFIG=$MODEL_DIR/pipeline.config | |
| export CHECKPOINT_PATH=$MODEL_DIR/model.ckpt-<CHECKPOINT NUMBER> | |
| export OUTPUT_DIR=$MODEL_DIR/tmp/tflite | |
| # Run the export_tflite_ssd_graph.py script to get the frozen graph | |
| # Make sure PYTHONPATH is updated |
This file contains hidden or 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
| python $TF_API_DIR/object_detection/builders/model_builder_test.py |
NewerOlder