Skip to content

Commit

Permalink
fix: Colab fix (georgia-tech-db#450)
Browse files Browse the repository at this point in the history
* fix custom model notebook
  • Loading branch information
jarulraj authored Oct 29, 2022
1 parent 7d7ed29 commit b680659
Show file tree
Hide file tree
Showing 7 changed files with 386 additions and 320 deletions.
19 changes: 10 additions & 9 deletions script/test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,24 @@ then
exit $linter_code
fi

# Run notebooks
PYTHONPATH=./ pytest --nbmake --overwrite "./tutorials" -s -v --log-level=WARNING
notebook_test_code=$?
if [ $notebook_test_code -ne 0 ];
then
cat tutorials/eva.log
exit $notebook_test_code
fi

# Run unit tests
PYTHONPATH=./ pytest test/ --cov-report term --cov-config=.coveragerc --cov=eva/ -s -v --log-level=WARNING ${1:-}
test_code=$?
if [ $test_code -ne 0 ];
then
exit $test_code
fi

# Run notebooks
PYTHONPATH=./ pytest --nbmake --overwrite "./tutorials" -s -v --log-level=WARNING
notebook_test_code=$?
if [ $notebook_test_code -ne 0 ];
then
cat tutorials/eva.log
exit $notebook_test_code
else
exit $linter_code
exit 0
fi

# restore __init__.py if it exists
Expand Down
6 changes: 3 additions & 3 deletions test/udfs/test_facenet_udf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def _load_image(self, path):
def test_should_return_batches_equivalent_to_number_of_frames(self):
from eva.udfs.face_detector import FaceDetector

single_face_img = self.base_path / "one.jpg"
multi_face_img = self.base_path / "multiface.jpg"
single_face_img = Path("data/facenet/one.jpg")
multi_face_img = Path("data/facenet/multiface.jpg")
frame_single_face = {
"id": 1,
"data": self._load_image(single_face_img),
Expand All @@ -63,7 +63,7 @@ def test_should_return_batches_equivalent_to_number_of_frames(self):
def test_should_run_on_gpu(self):
from eva.udfs.face_detector import FaceDetector

single_face_img = self.base_path / "one.jpg"
single_face_img = Path("data/facenet/one.jpg")
frame_single_face = {
"id": 1,
"data": self._load_image(single_face_img),
Expand Down
14 changes: 7 additions & 7 deletions tutorials/00-start-eva-server.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@
"execution_count": 1,
"metadata": {
"execution": {
"iopub.execute_input": "2022-10-29T20:25:34.905569Z",
"iopub.status.busy": "2022-10-29T20:25:34.905143Z",
"iopub.status.idle": "2022-10-29T20:25:45.623993Z",
"shell.execute_reply": "2022-10-29T20:25:45.622380Z"
"iopub.execute_input": "2022-10-29T22:26:37.669117Z",
"iopub.status.busy": "2022-10-29T22:26:37.668498Z",
"iopub.status.idle": "2022-10-29T22:26:48.436845Z",
"shell.execute_reply": "2022-10-29T22:26:48.435195Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"kill -9 $(lsof -ti:5432)\n"
"[ -z \"$(lsof -ti:5432)\" ] || kill -9 \"$(lsof -ti:5432)\"\n"
]
},
{
Expand All @@ -65,7 +65,7 @@
"\n",
"def stop_eva_server():\n",
" # Kill any process listening on EVA's standard port\n",
" shell('kill -9 $(lsof -ti:5432)')\n",
" shell('[ -z \"$(lsof -ti:5432)\" ] || kill -9 \"$(lsof -ti:5432)\"')\n",
"\n",
"def launch_eva_server():\n",
" # Stop EVA server if it is running\n",
Expand All @@ -80,7 +80,7 @@
" with open('eva.log', 'r') as f:\n",
" print(f.read())\n",
" except FileNotFoundError:\n",
" print(\"\")\n",
" pass\n",
"\n",
" # Wait for server to start\n",
" time.sleep(10)\n",
Expand Down
78 changes: 41 additions & 37 deletions tutorials/01-mnist.ipynb

Large diffs are not rendered by default.

168 changes: 89 additions & 79 deletions tutorials/02-object-detection.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit b680659

Please sign in to comment.