Spaces:
Runtime error
Runtime error
neverix
commited on
Commit
•
7e80faa
1
Parent(s):
e6d263a
Finishing touches on final Streamlit version
Browse files- app.py +2 -2
- data_loader.py +1 -1
app.py
CHANGED
@@ -53,11 +53,11 @@ if st.button("RUN!"):
|
|
53 |
for i, e in enumerate(sorted(upload_img2, key=lambda x: x.name)):
|
54 |
with open(f"poses/{i:04}.png", "wb") as f:
|
55 |
f.write(e.read())
|
56 |
-
st.info("
|
57 |
os.system("sh infer.sh")
|
58 |
st.info("Done!")
|
59 |
video_file=open("output.mp4", "rb")
|
60 |
video_bytes = video_file.read()
|
61 |
st.video(video_bytes, start_time=0)
|
62 |
else:
|
63 |
-
st.info("
|
|
|
53 |
for i, e in enumerate(sorted(upload_img2, key=lambda x: x.name)):
|
54 |
with open(f"poses/{i:04}.png", "wb") as f:
|
55 |
f.write(e.read())
|
56 |
+
st.info("Thinking...")
|
57 |
os.system("sh infer.sh")
|
58 |
st.info("Done!")
|
59 |
video_file=open("output.mp4", "rb")
|
60 |
video_bytes = video_file.read()
|
61 |
st.video(video_bytes, start_time=0)
|
62 |
else:
|
63 |
+
st.info("Please upload a picture")
|
data_loader.py
CHANGED
@@ -225,7 +225,7 @@ class FileDataset(Dataset):
|
|
225 |
|
226 |
if "labels" in sample:
|
227 |
# return UDP as 4chn XYZV float tensor
|
228 |
-
if sample["labels"].dtype
|
229 |
sample["labels"] = sample["labels"].astype(np.float32) / np.iinfo(sample["labels"].dtype).max
|
230 |
sample["labels"] = torch.from_numpy(
|
231 |
sample["labels"].transpose((2, 0, 1)))
|
|
|
225 |
|
226 |
if "labels" in sample:
|
227 |
# return UDP as 4chn XYZV float tensor
|
228 |
+
if "float" not in str(sample["labels"].dtype):
|
229 |
sample["labels"] = sample["labels"].astype(np.float32) / np.iinfo(sample["labels"].dtype).max
|
230 |
sample["labels"] = torch.from_numpy(
|
231 |
sample["labels"].transpose((2, 0, 1)))
|