Update scripts/data_processors/smpl/generate_smpls.py
Browse files
scripts/data_processors/smpl/generate_smpls.py
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import cv2
|
| 2 |
from pathlib import Path
|
| 3 |
import os
|
|
|
|
| 1 |
+
# =========================================================================
|
| 2 |
+
# 🎯 [路徑防禦補丁] 確保子程序被劫持進 venv 後,依然認得自己的專案根目錄路徑
|
| 3 |
+
# =========================================================================
|
| 4 |
+
import os
|
| 5 |
+
import sys
|
| 6 |
+
current_script_dir = os.path.dirname(os.path.abspath(__file__))
|
| 7 |
+
# 向上推 4 層,精準定位到 /app/champ-master 根目錄
|
| 8 |
+
master_root = os.path.abspath(os.path.join(current_script_dir, "..", "..", "..", ".."))
|
| 9 |
+
fourd_root = os.path.join(master_root, "4D-Humans")
|
| 10 |
+
|
| 11 |
+
if master_root not in sys.path:
|
| 12 |
+
sys.path.insert(0, master_root)
|
| 13 |
+
if fourd_root not in sys.path:
|
| 14 |
+
sys.path.insert(0, fourd_root)
|
| 15 |
+
# =========================================================================
|
| 16 |
+
|
| 17 |
import cv2
|
| 18 |
from pathlib import Path
|
| 19 |
import os
|