Skip to content

Commit

Permalink
final changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulMcHard committed May 20, 2024
1 parent 7728f4b commit 526d065
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN pip install --upgrade pip && pip install -r requirements.txt
COPY . .

# Expose gRPC server port
EXPOSE 500XX
EXPOSE 50099

# Define the command to run the server
CMD ["python", "regionDetection.py"]
Binary file modified __pycache__/regionDetection.cpython-311.pyc
Binary file not shown.
34 changes: 29 additions & 5 deletions icra_workshop.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,21 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "SyntaxError",
"evalue": "invalid decimal literal (regionDetection.py, line 26)",
"output_type": "error",
"traceback": [
"Traceback \u001b[1;36m(most recent call last)\u001b[0m:\n",
"\u001b[0m File \u001b[0;32mc:\\Users\\2085227M\\source\\repos\\projects\\ICRA\\.venv\\Lib\\site-packages\\IPython\\core\\interactiveshell.py:3577\u001b[0m in \u001b[0;35mrun_code\u001b[0m\n exec(code_obj, self.user_global_ns, self.user_ns)\u001b[0m\n",
"\u001b[1;36m Cell \u001b[1;32mIn[2], line 4\u001b[1;36m\n\u001b[1;33m from regionDetection import RegionDetectionService\u001b[1;36m\n",
"\u001b[1;36m File \u001b[1;32mc:\\Users\\2085227M\\source\\repos\\projects\\ICRA\\regionDetection.py:26\u001b[1;36m\u001b[0m\n\u001b[1;33m PORT = 500XX\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid decimal literal\n"
]
}
],
"source": [
"# imports\n",
"import cv2 \n",
Expand All @@ -25,13 +37,25 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "NameError",
"evalue": "name 'cv2' is not defined",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[1], line 8\u001b[0m\n\u001b[0;32m 6\u001b[0m data_dir \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mdata/\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[0;32m 7\u001b[0m img_file \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtest3.png\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[1;32m----> 8\u001b[0m image \u001b[38;5;241m=\u001b[39m \u001b[43mcv2\u001b[49m\u001b[38;5;241m.\u001b[39mimread(data_dir \u001b[38;5;241m+\u001b[39m img_file)\n\u001b[0;32m 9\u001b[0m rd \u001b[38;5;241m=\u001b[39m RegionDetectionService()\n\u001b[0;32m 10\u001b[0m polylines, vertices \u001b[38;5;241m=\u001b[39m rd\u001b[38;5;241m.\u001b[39mfind_regions(img\u001b[38;5;241m=\u001b[39mimage\u001b[38;5;241m.\u001b[39mcopy(), min_edges\u001b[38;5;241m=\u001b[39mminimum_edges, precision\u001b[38;5;241m=\u001b[39mprecision, binaryThreshold\u001b[38;5;241m=\u001b[39mblack_threshold)\n",
"\u001b[1;31mNameError\u001b[0m: name 'cv2' is not defined"
]
}
],
"source": [
"# Fine tune Parameters - Remember to copy final values into regionDetection.py at line 21 before submitting!\n",
"minimum_edges = 3\n",
"precision = 0.001\n",
"precision = 0.02\n",
"black_threshold = 120\n",
"\n",
"data_dir = 'data/'\n",
Expand Down
2 changes: 1 addition & 1 deletion regionDetection.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
PRECISION = 0.01
THRESHOLD = 120

PORT = 500XX
PORT = 50099
ALIAS = "Paul McHard"

# End of Variables
Expand Down

0 comments on commit 526d065

Please sign in to comment.