Spaces:
Sleeping
Sleeping
Commit ·
32371f9
1
Parent(s): 8d3e73e
Some fixes to get it running
Browse files- evaluate.py +5 -4
- install.sh +19 -14
- neus_v/video/frame.py +1 -6
- neus_v/video/read_video.py +2 -4
- neus_v/video/video.py +2 -6
- neus_v/vlm/obj.py +1 -0
evaluate.py
CHANGED
|
@@ -16,7 +16,8 @@ warnings.filterwarnings(
|
|
| 16 |
)
|
| 17 |
|
| 18 |
# Paths and parameters
|
| 19 |
-
WEIGHT_PATH = Path("/opt/mars/mnt/model_weights")
|
|
|
|
| 20 |
pickle_path = WEIGHT_PATH / "distributions.pkl"
|
| 21 |
num_of_frame_in_sequence = 3
|
| 22 |
model = "InternVL2-8B"
|
|
@@ -70,8 +71,8 @@ def demo_interface(video, propositions, tl):
|
|
| 70 |
|
| 71 |
def main():
|
| 72 |
# Example data from the original script
|
| 73 |
-
example_video_path_1 = "/
|
| 74 |
-
example_video_path_2 = "/
|
| 75 |
example_propositions = "waves lapping,ocean shore,storm bursts in,lightning on the sky"
|
| 76 |
example_tl = '("waves_lapping" & "ocean_shore") U ("storm_bursts_in" U "lightning_on_the_sky")'
|
| 77 |
|
|
@@ -91,7 +92,7 @@ def main():
|
|
| 91 |
],
|
| 92 |
)
|
| 93 |
|
| 94 |
-
demo.launch(allowed_paths=["/
|
| 95 |
|
| 96 |
|
| 97 |
if __name__ == "__main__":
|
|
|
|
| 16 |
)
|
| 17 |
|
| 18 |
# Paths and parameters
|
| 19 |
+
# WEIGHT_PATH = Path("/opt/mars/mnt/model_weights")
|
| 20 |
+
WEIGHT_PATH = Path("/nas/mars/model_weights/")
|
| 21 |
pickle_path = WEIGHT_PATH / "distributions.pkl"
|
| 22 |
num_of_frame_in_sequence = 3
|
| 23 |
model = "InternVL2-8B"
|
|
|
|
| 71 |
|
| 72 |
def main():
|
| 73 |
# Example data from the original script
|
| 74 |
+
example_video_path_1 = "/nas/mars/dataset/teaser/A_storm_bursts_in_with_intermittent_lightning_and_causes_flooding_and_large_waves_crash_in.mp4"
|
| 75 |
+
example_video_path_2 = "/nas/mars/dataset/teaser/The ocean waves gently lapping at the shore, until a storm bursts in, and then lightning flashes across the sky.mp4"
|
| 76 |
example_propositions = "waves lapping,ocean shore,storm bursts in,lightning on the sky"
|
| 77 |
example_tl = '("waves_lapping" & "ocean_shore") U ("storm_bursts_in" U "lightning_on_the_sky")'
|
| 78 |
|
|
|
|
| 92 |
],
|
| 93 |
)
|
| 94 |
|
| 95 |
+
demo.launch(allowed_paths=["/nas/mars/dataset/teaser"])
|
| 96 |
|
| 97 |
|
| 98 |
if __name__ == "__main__":
|
install.sh
CHANGED
|
@@ -6,20 +6,16 @@ pip install transformers
|
|
| 6 |
pip install decord
|
| 7 |
pip install opencv-python
|
| 8 |
pip install joblib
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
-
#
|
| 11 |
sudo apt install libboost-all-dev m4
|
|
|
|
|
|
|
| 12 |
|
| 13 |
-
mkdir build
|
| 14 |
-
cd build
|
| 15 |
-
wget https://github.com/moves-rwth/storm/archive/stable.zip
|
| 16 |
-
unzip stable.zip
|
| 17 |
-
cd storm-stable
|
| 18 |
-
mkdir build
|
| 19 |
-
cd build
|
| 20 |
-
cmake ..
|
| 21 |
-
|
| 22 |
-
# Carl
|
| 23 |
cd FILLEMEUP
|
| 24 |
git clone https://github.com/moves-rwth/carl-storm
|
| 25 |
cd carl-storm
|
|
@@ -28,7 +24,16 @@ cd build
|
|
| 28 |
cmake ..
|
| 29 |
make lib_carl
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
|
| 33 |
-
pip install pycarl
|
| 34 |
-
pip install stormpy
|
|
|
|
| 6 |
pip install decord
|
| 7 |
pip install opencv-python
|
| 8 |
pip install joblib
|
| 9 |
+
pip install einops
|
| 10 |
+
pip install timm
|
| 11 |
+
pip install accelerate
|
| 12 |
+
pip install sentencepiece
|
| 13 |
|
| 14 |
+
# Carl
|
| 15 |
sudo apt install libboost-all-dev m4
|
| 16 |
+
sudo apt install libginac-dev libglpk-dev
|
| 17 |
+
# sudo apt install build-essential git cmake libboost-all-dev libcln-dev libgmp-dev libginac-dev automake libglpk-dev libhwloc-dev
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
cd FILLEMEUP
|
| 20 |
git clone https://github.com/moves-rwth/carl-storm
|
| 21 |
cd carl-storm
|
|
|
|
| 24 |
cmake ..
|
| 25 |
make lib_carl
|
| 26 |
|
| 27 |
+
# Storm
|
| 28 |
+
mkdir build
|
| 29 |
+
cd build
|
| 30 |
+
wget https://github.com/moves-rwth/storm/archive/stable.zip
|
| 31 |
+
unzip stable.zip
|
| 32 |
+
cd storm-stable
|
| 33 |
+
mkdir build
|
| 34 |
+
cd build
|
| 35 |
+
cmake ../ -DCMAKE_BUILD_TYPE=Release -DSTORM_DEVELOPER=OFF -DSTORM_LOG_DISABLE_DEBUG=ON -DSTORM_PORTABLE=ON -DSTORM_USE_SPOT_SHIPPED=ON make
|
| 36 |
+
make -j12
|
| 37 |
+
# export PATH=$PATH:/opt/storm/build/bin
|
| 38 |
|
| 39 |
+
pip install stormpy
|
|
|
|
|
|
neus_v/video/frame.py
CHANGED
|
@@ -1,10 +1,7 @@
|
|
| 1 |
import dataclasses
|
| 2 |
-
from typing import TYPE_CHECKING
|
| 3 |
|
| 4 |
import cv2
|
| 5 |
-
|
| 6 |
-
if TYPE_CHECKING:
|
| 7 |
-
import numpy as np
|
| 8 |
|
| 9 |
|
| 10 |
@dataclasses.dataclass
|
|
@@ -77,5 +74,3 @@ class VideoFrame:
|
|
| 77 |
bboxes += obj_value.bounding_box_of_all_obj
|
| 78 |
|
| 79 |
return bboxes
|
| 80 |
-
|
| 81 |
-
|
|
|
|
| 1 |
import dataclasses
|
|
|
|
| 2 |
|
| 3 |
import cv2
|
| 4 |
+
import numpy as np
|
|
|
|
|
|
|
| 5 |
|
| 6 |
|
| 7 |
@dataclasses.dataclass
|
|
|
|
| 74 |
bboxes += obj_value.bounding_box_of_all_obj
|
| 75 |
|
| 76 |
return bboxes
|
|
|
|
|
|
neus_v/video/read_video.py
CHANGED
|
@@ -1,10 +1,8 @@
|
|
| 1 |
from pathlib import Path
|
| 2 |
-
from typing import TYPE_CHECKING
|
| 3 |
|
| 4 |
-
|
| 5 |
|
| 6 |
-
|
| 7 |
-
import numpy as np
|
| 8 |
|
| 9 |
|
| 10 |
def read_video(
|
|
|
|
| 1 |
from pathlib import Path
|
|
|
|
| 2 |
|
| 3 |
+
import numpy as np
|
| 4 |
|
| 5 |
+
from neus_v.video.video import Video, VideoFormat
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
def read_video(
|
neus_v/video/video.py
CHANGED
|
@@ -2,16 +2,12 @@ import enum
|
|
| 2 |
import logging
|
| 3 |
import uuid
|
| 4 |
from dataclasses import dataclass, field
|
| 5 |
-
from
|
| 6 |
|
| 7 |
import cv2
|
|
|
|
| 8 |
from PIL import Image
|
| 9 |
|
| 10 |
-
if TYPE_CHECKING:
|
| 11 |
-
from pathlib import Path
|
| 12 |
-
|
| 13 |
-
import numpy as np
|
| 14 |
-
|
| 15 |
|
| 16 |
class VideoFormat(enum.Enum):
|
| 17 |
"""Status Enum for the CV API."""
|
|
|
|
| 2 |
import logging
|
| 3 |
import uuid
|
| 4 |
from dataclasses import dataclass, field
|
| 5 |
+
from pathlib import Path
|
| 6 |
|
| 7 |
import cv2
|
| 8 |
+
import numpy as np
|
| 9 |
from PIL import Image
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
class VideoFormat(enum.Enum):
|
| 13 |
"""Status Enum for the CV API."""
|
neus_v/vlm/obj.py
CHANGED
|
@@ -14,6 +14,7 @@ class Status(enum.Enum):
|
|
| 14 |
INVALID = 4
|
| 15 |
|
| 16 |
|
|
|
|
| 17 |
class DetectedObject:
|
| 18 |
"""Detected Object class."""
|
| 19 |
|
|
|
|
| 14 |
INVALID = 4
|
| 15 |
|
| 16 |
|
| 17 |
+
@dataclasses.dataclass
|
| 18 |
class DetectedObject:
|
| 19 |
"""Detected Object class."""
|
| 20 |
|