Spaces:
Running
Running
Daniel Gil-U Fuhge
commited on
Commit
•
feb48ca
1
Parent(s):
62fc38e
add demugging code
Browse files
src/preprocessing/preprocessing.py
CHANGED
@@ -4,6 +4,7 @@ import copy
|
|
4 |
import torch
|
5 |
import glob
|
6 |
import pandas as pd
|
|
|
7 |
import pickle
|
8 |
from xml.dom import minidom
|
9 |
from svgpathtools import svg2paths2
|
@@ -48,6 +49,7 @@ def compute_embedding(path: str, model_path: str, save: str = None) -> pd.DataFr
|
|
48 |
|
49 |
# Assign animation id to every path - TODO this changes the original logo!
|
50 |
document = minidom.parseString(svg_str)
|
|
|
51 |
paths = document.getElementsByTagName('path')
|
52 |
for i in range(len(paths)):
|
53 |
paths[i].setAttribute('animation_id', str(i))
|
@@ -59,6 +61,7 @@ def compute_embedding(path: str, model_path: str, save: str = None) -> pd.DataFr
|
|
59 |
decomposed_svgs = {}
|
60 |
|
61 |
for i in range(len(paths)):
|
|
|
62 |
doc_temp = copy.deepcopy(document)
|
63 |
paths_temp = doc_temp.getElementsByTagName('path')
|
64 |
current_path = paths_temp[i]
|
|
|
4 |
import torch
|
5 |
import glob
|
6 |
import pandas as pd
|
7 |
+
import streamlit as st
|
8 |
import pickle
|
9 |
from xml.dom import minidom
|
10 |
from svgpathtools import svg2paths2
|
|
|
49 |
|
50 |
# Assign animation id to every path - TODO this changes the original logo!
|
51 |
document = minidom.parseString(svg_str)
|
52 |
+
|
53 |
paths = document.getElementsByTagName('path')
|
54 |
for i in range(len(paths)):
|
55 |
paths[i].setAttribute('animation_id', str(i))
|
|
|
61 |
decomposed_svgs = {}
|
62 |
|
63 |
for i in range(len(paths)):
|
64 |
+
st.write(document)
|
65 |
doc_temp = copy.deepcopy(document)
|
66 |
paths_temp = doc_temp.getElementsByTagName('path')
|
67 |
current_path = paths_temp[i]
|