Skip to content

Instantly share code, notes, and snippets.

View ivanliu1989's full-sized avatar
๐Ÿง‘โ€๐Ÿผ
Generating Agentic AIs

Tianxiang(Ivan) Liu ivanliu1989

๐Ÿง‘โ€๐Ÿผ
Generating Agentic AIs
View GitHub Profile
@ivanliu1989
ivanliu1989 / lyra.txt
Created October 1, 2025 22:15 — forked from xthezealot/lyra.txt
Lyra - AI Prompt Optimization Specialist
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
docker run -it --rm tensorflow/tensorflow:latest-devel-py3 bash
# 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
# 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=.
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
# 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
# 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 \
# 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
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
python $TF_API_DIR/object_detection/builders/model_builder_test.py