Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
jarulraj committed Mar 27, 2023
1 parent c138f73 commit 2b11bb2
Show file tree
Hide file tree
Showing 15 changed files with 42 additions and 41 deletions.
4 changes: 3 additions & 1 deletion eva/udfs/udf_bootstrap_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ def init_builtin_udfs(mode="debug"):
Open_udf_query,
Similarity_udf_query
# Disabled because required packages (eg., easy_ocr might not be preinstalled)
# YoloV5_udf_query,
# face_detection_udf_query,
# ocr_udf_query,
# Disabled as it requires specific pytorch package
Expand All @@ -196,5 +195,8 @@ def init_builtin_udfs(mode="debug"):
]
)

if mode != "minimal":
queries.extend([YoloV5_udf_query])

for query in queries:
execute_query_fetch_all(query)
4 changes: 2 additions & 2 deletions test/benchmark_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from test.util import load_inbuilt_udfs
from test.util import load_udfs_for_testing

import pytest

Expand All @@ -25,7 +25,7 @@ def setup_pytorch_tests():
CatalogManager().reset()
execute_query_fetch_all("LOAD VIDEO 'data/ua_detrac/ua_detrac.mp4' INTO MyVideo;")
execute_query_fetch_all("LOAD VIDEO 'data/mnist/mnist.mp4' INTO MNIST;")
load_inbuilt_udfs()
load_udfs_for_testing()
from eva.udfs.udf_bootstrap_queries import YoloV5_udf_query

execute_query_fetch_all(YoloV5_udf_query)
Expand Down
9 changes: 7 additions & 2 deletions test/integration_tests/test_array_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import unittest
from test.util import NUM_FRAMES, create_sample_video, file_remove, load_inbuilt_udfs
from test.util import (
NUM_FRAMES,
create_sample_video,
file_remove,
load_udfs_for_testing,
)

import pandas as pd
import pytest
Expand All @@ -31,7 +36,7 @@ def setUpClass(cls):
video_file_path = create_sample_video(NUM_FRAMES)
load_query = f"LOAD VIDEO '{video_file_path}' INTO MyVideo;"
execute_query_fetch_all(load_query)
load_inbuilt_udfs()
load_udfs_for_testing(mode="minimal")

@classmethod
def tearDownClass(cls):
Expand Down
5 changes: 2 additions & 3 deletions test/integration_tests/test_create_index_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import os
import unittest
from pathlib import Path
from test.util import load_inbuilt_udfs
from test.util import load_udfs_for_testing

import faiss
import numpy as np
Expand Down Expand Up @@ -53,8 +53,7 @@ def setUpClass(cls):

# Reset catalog.
CatalogManager().reset()

load_inbuilt_udfs()
load_udfs_for_testing(mode="minimal")

# Create feature vector table and raw input table.
feat1 = np.array([[0, 0, 0]]).astype(np.float32)
Expand Down
5 changes: 2 additions & 3 deletions test/integration_tests/test_delete_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import unittest
from test.util import file_remove, load_inbuilt_udfs
from test.util import file_remove, load_udfs_for_testing

import numpy as np
import pytest
Expand All @@ -32,8 +32,7 @@ def setUp(self):

# Reset catalog.
CatalogManager().reset()

load_inbuilt_udfs()
load_udfs_for_testing(mode="minimal")

create_table_query = """
CREATE TABLE IF NOT EXISTS testDeleteOne
Expand Down
9 changes: 7 additions & 2 deletions test/integration_tests/test_explain_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import unittest
from test.util import create_sample_video, create_table, file_remove, load_inbuilt_udfs
from test.util import (
create_sample_video,
create_table,
file_remove,
load_udfs_for_testing,
)

import pytest

Expand All @@ -39,7 +44,7 @@ def setUpClass(cls):
video_file_path = create_sample_video(NUM_FRAMES)
load_query = f"LOAD VIDEO '{video_file_path}' INTO MyVideo;"
execute_query_fetch_all(load_query)
load_inbuilt_udfs()
load_udfs_for_testing(mode="minimal")
cls.table1 = create_table("table1", 100, 3)
cls.table2 = create_table("table2", 500, 3)
cls.table3 = create_table("table3", 1000, 3)
Expand Down
5 changes: 2 additions & 3 deletions test/integration_tests/test_insert_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import unittest
from test.util import create_sample_video, file_remove, load_inbuilt_udfs
from test.util import create_sample_video, file_remove, load_udfs_for_testing

import numpy as np
import pandas as pd
Expand All @@ -37,8 +37,7 @@ def setUp(self):
);
"""
execute_query_fetch_all(query)

load_inbuilt_udfs()
load_udfs_for_testing(mode="minimal")

def tearDown(self):
file_remove("dummy.avi")
Expand Down
7 changes: 2 additions & 5 deletions test/integration_tests/test_mat_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
DummyObjectDetector,
create_sample_video,
file_remove,
load_inbuilt_udfs,
load_udfs_for_testing,
)

import pandas as pd
Expand All @@ -42,10 +42,7 @@ def setUpClass(cls):
execute_query_fetch_all(load_query)
ua_detrac = f"{EVA_ROOT_DIR}/data/ua_detrac/ua_detrac.mp4"
execute_query_fetch_all(f"LOAD VIDEO '{ua_detrac}' INTO UATRAC;")
load_inbuilt_udfs()
from eva.udfs.udf_bootstrap_queries import YoloV5_udf_query

execute_query_fetch_all(YoloV5_udf_query)
load_udfs_for_testing()

@classmethod
def tearDownClass(cls):
Expand Down
4 changes: 2 additions & 2 deletions test/integration_tests/test_open.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import unittest
from test.util import create_sample_image, file_remove, load_inbuilt_udfs
from test.util import create_sample_image, file_remove, load_udfs_for_testing

import numpy as np
import pandas as pd
Expand All @@ -32,7 +32,7 @@ def setUp(self):
CatalogManager().reset()
ConfigurationManager()
# Load built-in UDFs.
load_inbuilt_udfs()
load_udfs_for_testing(mode="minimal")

# Insert image path.
self.img_path = create_sample_image()
Expand Down
4 changes: 2 additions & 2 deletions test/integration_tests/test_optimizer_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import unittest
from test.util import get_physical_query_plan, load_inbuilt_udfs
from test.util import get_physical_query_plan, load_udfs_for_testing

import pytest
from mock import MagicMock, patch
Expand Down Expand Up @@ -42,7 +42,7 @@ def setUpClass(cls):
ua_detrac = f"{EVA_ROOT_DIR}/data/ua_detrac/ua_detrac.mp4"
execute_query_fetch_all(f"LOAD VIDEO '{ua_detrac}' INTO MyVideo;")
execute_query_fetch_all(f"LOAD VIDEO '{ua_detrac}' INTO MyVideo2;")
load_inbuilt_udfs()
load_udfs_for_testing(mode="minimal")

@classmethod
def tearDownClass(cls):
Expand Down
7 changes: 2 additions & 5 deletions test/integration_tests/test_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import os
import unittest
from test.markers import windows_skip_marker
from test.util import file_remove, load_inbuilt_udfs
from test.util import file_remove, load_udfs_for_testing

import cv2
import numpy as np
Expand Down Expand Up @@ -50,10 +50,7 @@ def setUpClass(cls):
execute_query_fetch_all(f"LOAD VIDEO '{asl_actions}' INTO Asl_actions;")
execute_query_fetch_all(f"LOAD IMAGE '{meme1}' INTO MemeImages;")
execute_query_fetch_all(f"LOAD IMAGE '{meme2}' INTO MemeImages;")
load_inbuilt_udfs()
from eva.udfs.udf_bootstrap_queries import YoloV5_udf_query

execute_query_fetch_all(YoloV5_udf_query)
load_udfs_for_testing()

@classmethod
def tearDownClass(cls):
Expand Down
7 changes: 2 additions & 5 deletions test/integration_tests/test_select_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
create_table,
file_remove,
get_logical_query_plan,
load_inbuilt_udfs,
load_udfs_for_testing,
)

import numpy as np
Expand Down Expand Up @@ -48,10 +48,7 @@ def setUpClass(cls):
ua_detrac = f"{EVA_ROOT_DIR}/data/ua_detrac/ua_detrac.mp4"
load_query = f"LOAD VIDEO '{ua_detrac}' INTO DETRAC;"
execute_query_fetch_all(load_query)
load_inbuilt_udfs()
from eva.udfs.udf_bootstrap_queries import YoloV5_udf_query

execute_query_fetch_all(YoloV5_udf_query)
load_udfs_for_testing()
cls.table1 = create_table("table1", 100, 3)
cls.table2 = create_table("table2", 500, 3)
cls.table3 = create_table("table3", 1000, 3)
Expand Down
4 changes: 2 additions & 2 deletions test/integration_tests/test_similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import unittest
from test.util import create_sample_image, load_inbuilt_udfs
from test.util import create_sample_image, load_udfs_for_testing

import numpy as np
import pandas as pd
Expand All @@ -31,7 +31,7 @@ def setUp(self):
CatalogManager().reset()

# Prepare needed UDFs and data_col.
load_inbuilt_udfs()
load_udfs_for_testing(mode="minimal")
self.img_path = create_sample_image()

# Create base comparison table.
Expand Down
4 changes: 2 additions & 2 deletions test/optimizer/rules/test_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import unittest
from test.util import create_sample_video, load_inbuilt_udfs
from test.util import create_sample_video, load_udfs_for_testing

import pytest
from mock import MagicMock, patch
Expand Down Expand Up @@ -84,7 +84,7 @@ def setUpClass(cls):
video_file_path = create_sample_video()
load_query = f"LOAD VIDEO '{video_file_path}' INTO MyVideo;"
execute_query_fetch_all(load_query)
load_inbuilt_udfs()
load_udfs_for_testing(mode="minimal")

@classmethod
def tearDownClass(cls):
Expand Down
5 changes: 3 additions & 2 deletions test/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,9 @@ def create_dummy_4d_batches(
yield Batch(df)


def load_inbuilt_udfs():
mode = ConfigurationManager().get_value("core", "mode")
def load_udfs_for_testing(mode="debug"):
# DEBUG OR RELEASE MODE: ALL UDFs
# MINIMAL MODE: NO YOLO
init_builtin_udfs(mode=mode)


Expand Down

0 comments on commit 2b11bb2

Please sign in to comment.