IQ.Pilot Release Commit @ 0798119
This commit is contained in:
23
tools/iqmacvisiond/macos/SIGNING.md
Normal file
23
tools/iqmacvisiond/macos/SIGNING.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# Signing & notarization — IQ Vision.app
|
||||
|
||||
Unsigned, the app runs after a right-click ▸ Open (Gatekeeper first-run). For
|
||||
distribution, sign + notarize:
|
||||
|
||||
```bash
|
||||
APP="tools/iqmacvisiond/macos/dist/IQ Vision.app"
|
||||
ENT="tools/iqmacvisiond/macos/entitlements.plist"
|
||||
IDENTITY="Developer ID Application: <YOUR NAME> (<TEAMID>)"
|
||||
|
||||
codesign --force --deep --options runtime --entitlements "$ENT" \
|
||||
--sign "$IDENTITY" "$APP"
|
||||
|
||||
hdiutil create -volname "IQ Vision" -srcfolder "$(dirname "$APP")" -ov -format UDZO \
|
||||
tools/iqmacvisiond/macos/dist/IQVision.dmg
|
||||
|
||||
xcrun notarytool submit tools/iqmacvisiond/macos/dist/IQVision.dmg \
|
||||
--apple-id "<APPLE_ID>" --team-id "<TEAMID>" --password "<APP_PW>" --wait
|
||||
xcrun stapler staple tools/iqmacvisiond/macos/dist/IQVision.dmg
|
||||
```
|
||||
|
||||
The entitlements cover: JIT + unsigned exec memory + library-validation off
|
||||
(tinygrad Metal JIT) and network server/client (LAN discovery + inference).
|
||||
59
tools/iqmacvisiond/macos/build_dmg.sh
Executable file
59
tools/iqmacvisiond/macos/build_dmg.sh
Executable file
@@ -0,0 +1,59 @@
|
||||
#!/bin/bash
|
||||
# Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos/
|
||||
set -euo pipefail
|
||||
|
||||
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
||||
REPO="$(cd "$HERE/../../.." >/dev/null && pwd)"
|
||||
OUT="${1:-$HERE/dist}"
|
||||
APP="$OUT/IQ Vision.app"
|
||||
|
||||
rm -rf "$OUT"
|
||||
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
|
||||
|
||||
cat > "$APP/Contents/Info.plist" <<'PLIST'
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleName</key><string>IQ Vision</string>
|
||||
<key>CFBundleIdentifier</key><string>com.iqpilot.iqvision</string>
|
||||
<key>CFBundleVersion</key><string>1.0</string>
|
||||
<key>CFBundleShortVersionString</key><string>1.0</string>
|
||||
<key>CFBundlePackageType</key><string>APPL</string>
|
||||
<key>CFBundleExecutable</key><string>iqvision</string>
|
||||
<key>LSMinimumSystemVersion</key><string>13.0</string>
|
||||
<key>LSUIElement</key><true/>
|
||||
</dict>
|
||||
</plist>
|
||||
PLIST
|
||||
|
||||
cat > "$APP/Contents/MacOS/iqvision" <<'LAUNCH'
|
||||
#!/bin/bash
|
||||
RES="$(cd "$(dirname "$0")/../Resources" && pwd)"
|
||||
if [ ! -x "$HOME/Library/Application Support/IQVision/venv/bin/python" ]; then
|
||||
osascript -e "tell application \"Terminal\"
|
||||
activate
|
||||
do script \"bash '$RES/macos/setup.sh'\"
|
||||
end tell"
|
||||
else
|
||||
exec bash "$RES/macos/setup.sh" >/tmp/iqvision.log 2>&1
|
||||
fi
|
||||
LAUNCH
|
||||
chmod +x "$APP/Contents/MacOS/iqvision"
|
||||
|
||||
RES="$APP/Contents/Resources"
|
||||
SRC="$RES/openpilot/iqpilot/iqvd_private_src"
|
||||
mkdir -p "$RES/tools/iqmacvisiond" "$RES/macos" "$SRC/offload" "$SRC/models"
|
||||
|
||||
cp "$REPO/tools/iqmacvisiond/server.py" "$REPO/tools/iqmacvisiond/menubar.py" "$RES/tools/iqmacvisiond/"
|
||||
cp "$HERE/setup.sh" "$RES/macos/"
|
||||
cp "$REPO/iqpilot/iqvd_private_src/__init__.py" "$REPO/iqpilot/iqvd_private_src/yolov8_net.py" "$SRC/"
|
||||
cp "$REPO/iqpilot/iqvd_private_src/offload/"*.py "$SRC/offload/"
|
||||
cp "$REPO/iqpilot/iqvd_private_src/models/yolov8n.safetensors" "$SRC/models/"
|
||||
touch "$RES/openpilot/__init__.py" "$RES/openpilot/iqpilot/__init__.py" "$RES/tools/__init__.py" \
|
||||
"$RES/tools/iqmacvisiond/__init__.py"
|
||||
rsync -a --exclude=".git" --exclude="__pycache__" --exclude="extra" --exclude="test" \
|
||||
--exclude="examples" --exclude="docs" "$REPO/tinygrad_repo/" "$RES/tinygrad_repo/"
|
||||
|
||||
hdiutil create -volname "IQ Vision" -srcfolder "$OUT" -ov -format UDZO "$OUT/IQVision.dmg" >/dev/null
|
||||
echo "built: $OUT/IQVision.dmg ($(du -h "$OUT/IQVision.dmg" | cut -f1))"
|
||||
11
tools/iqmacvisiond/macos/entitlements.plist
Normal file
11
tools/iqmacvisiond/macos/entitlements.plist
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.cs.allow-jit</key><true/>
|
||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key><true/>
|
||||
<key>com.apple.security.cs.disable-library-validation</key><true/>
|
||||
<key>com.apple.security.network.server</key><true/>
|
||||
<key>com.apple.security.network.client</key><true/>
|
||||
</dict>
|
||||
</plist>
|
||||
21
tools/iqmacvisiond/macos/setup.sh
Executable file
21
tools/iqmacvisiond/macos/setup.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
# Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos/
|
||||
set -euo pipefail
|
||||
|
||||
RES="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null && pwd)"
|
||||
SUPPORT="$HOME/Library/Application Support/IQVision"
|
||||
VENV="$SUPPORT/venv"
|
||||
PY="$VENV/bin/python"
|
||||
|
||||
mkdir -p "$SUPPORT"
|
||||
|
||||
if [ ! -x "$PY" ]; then
|
||||
echo "Creating IQ Vision environment (one time)…"
|
||||
/usr/bin/python3 -m venv "$VENV"
|
||||
"$PY" -m pip install --upgrade --quiet pip
|
||||
"$PY" -m pip install --quiet numpy "opencv-python-headless>=4.8" rumps
|
||||
fi
|
||||
|
||||
export PYTHONPATH="$RES:$RES/tinygrad_repo"
|
||||
export DEV=METAL
|
||||
exec "$PY" "$RES/tools/iqmacvisiond/menubar.py"
|
||||
Reference in New Issue
Block a user