Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,7 @@ from collections import defaultdict
|
|
| 13 |
from langgraph.graph import StateGraph, END
|
| 14 |
import uuid
|
| 15 |
import shutil, time, functools
|
| 16 |
-
from io import BytesIO
|
| 17 |
from pathlib import Path
|
| 18 |
from utils.block_relation_builder import block_builder, separate_scripts, transform_logic_to_action_flow, analyze_opcode_counts
|
| 19 |
from difflib import get_close_matches
|
|
@@ -456,7 +456,7 @@ def run_query_search_flow(
|
|
| 456 |
query_sig_path = None
|
| 457 |
|
| 458 |
if query_sig_path:
|
| 459 |
-
try:
|
| 460 |
query_sig = gis.generate_signature(query_sig_path)
|
| 461 |
except Exception as e:
|
| 462 |
print(f"[ImageSignature] failed for query: {e}")
|
|
@@ -1702,9 +1702,12 @@ def similarity_matching(sprites_data: dict, project_folder: str, top_k: int = 1,
|
|
| 1702 |
from typing import List, Tuple
|
| 1703 |
os.makedirs(project_folder, exist_ok=True)
|
| 1704 |
|
| 1705 |
-
backdrop_base_path = r"D:\DEV PATEL\2025\scratch_VLM\scratch_agent\blocks\Backdrops"
|
| 1706 |
-
sprite_base_path = r"D:\DEV PATEL\2025\scratch_VLM\scratch_agent\blocks\sprites"
|
| 1707 |
-
code_blocks_path = r"D:\DEV PATEL\2025\scratch_VLM\scratch_agent\blocks\code_blocks"
|
|
|
|
|
|
|
|
|
|
| 1708 |
# out_path = r"D:\DEV PATEL\2025\scratch_VLM\scratch_agent\blocks\out_json"
|
| 1709 |
|
| 1710 |
project_json_path = os.path.join(project_folder, "project.json")
|
|
|
|
| 13 |
from langgraph.graph import StateGraph, END
|
| 14 |
import uuid
|
| 15 |
import shutil, time, functools
|
| 16 |
+
from io import BytesIO
|
| 17 |
from pathlib import Path
|
| 18 |
from utils.block_relation_builder import block_builder, separate_scripts, transform_logic_to_action_flow, analyze_opcode_counts
|
| 19 |
from difflib import get_close_matches
|
|
|
|
| 456 |
query_sig_path = None
|
| 457 |
|
| 458 |
if query_sig_path:
|
| 459 |
+
try:
|
| 460 |
query_sig = gis.generate_signature(query_sig_path)
|
| 461 |
except Exception as e:
|
| 462 |
print(f"[ImageSignature] failed for query: {e}")
|
|
|
|
| 1702 |
from typing import List, Tuple
|
| 1703 |
os.makedirs(project_folder, exist_ok=True)
|
| 1704 |
|
| 1705 |
+
# backdrop_base_path = r"D:\DEV PATEL\2025\scratch_VLM\scratch_agent\blocks\Backdrops"
|
| 1706 |
+
# sprite_base_path = r"D:\DEV PATEL\2025\scratch_VLM\scratch_agent\blocks\sprites"
|
| 1707 |
+
# code_blocks_path = r"D:\DEV PATEL\2025\scratch_VLM\scratch_agent\blocks\code_blocks"
|
| 1708 |
+
backdrop_base_path = os.path.normpath(str(BACKDROP_DIR))
|
| 1709 |
+
sprite_base_path = os.path.normpath(str(SPRITE_DIR))
|
| 1710 |
+
code_blocks_path = os.path.normpath(str(CODE_BLOCKS_DIR))
|
| 1711 |
# out_path = r"D:\DEV PATEL\2025\scratch_VLM\scratch_agent\blocks\out_json"
|
| 1712 |
|
| 1713 |
project_json_path = os.path.join(project_folder, "project.json")
|