Skip to content

Commit

Permalink
Merge pull request #202 from josephofiowa/main
Browse files Browse the repository at this point in the history
updated API_KEY to ROBOFLOW_API_KEY for clarity
  • Loading branch information
paulguerrie committed Dec 20, 2023
2 parents 2b07000 + 983bac2 commit f64d58c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions docs/foundation/gaze.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ import requests
import os

IMG_PATH = "image.jpg"
API_KEY = os.environ["API_KEY"]
ROBOFLOW_API_KEY = os.environ["ROBOFLOW_API_KEY"]
DISTANCE_TO_OBJECT = 1000 # mm
HEIGHT_OF_HUMAN_FACE = 250 # mm
GAZE_DETECTION_URL = "http://127.0.0.1:9001/gaze/gaze_detection?api_key=" + API_KEY
GAZE_DETECTION_URL = "http://127.0.0.1:9001/gaze/gaze_detection?api_key=" + ROBOFLOW_API_KEY

def detect_gazes(frame: np.ndarray):
img_encode = cv2.imencode(".jpg", frame)[1]
img_base64 = base64.b64encode(img_encode)
resp = requests.post(
GAZE_DETECTION_URL,
json={
"api_key": API_KEY,
"api_key": ROBOFLOW_API_KEY,
"image": {"type": "base64", "value": img_base64.decode("utf-8")},
},
)
Expand Down
4 changes: 2 additions & 2 deletions examples/gaze-detection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ git clone https://github.com/roboflow/inference
cd inference/examples/gaze-detection
```

Next, set up a Python environment and install the required project dependencies:
Next, set up a Python environment and install the required project dependencies (this assumes running these bash commands from the above terminal window install):

```bash
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install -r ../../requirements/_requirements.txt
```

Next, set up a Roboflow Inference Docker container. This Docker container will manage inference for the gaze detection system. [Learn how to set up an Inference Docker container](https://inference.roboflow.com/quickstart/docker/).
Expand Down
6 changes: 3 additions & 3 deletions examples/gaze-detection/gaze.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import os

IMG_PATH = "image.jpg"
API_KEY = os.environ["API_KEY"]
ROBOFLOW_API_KEY = os.environ["ROBOFLOW_API_KEY"]
DISTANCE_TO_OBJECT = 1000 # mm
HEIGHT_OF_HUMAN_FACE = 250 # mm
GAZE_DETECTION_URL = "http://127.0.0.1:9001/gaze/gaze_detection?api_key=" + API_KEY
GAZE_DETECTION_URL = "http://127.0.0.1:9001/gaze/gaze_detection?api_key=" + ROBOFLOW_API_KEY


def detect_gazes(frame: np.ndarray):
Expand All @@ -18,7 +18,7 @@ def detect_gazes(frame: np.ndarray):
resp = requests.post(
GAZE_DETECTION_URL,
json={
"api_key": API_KEY,
"api_key": ROBOFLOW_API_KEY,
"image": {"type": "base64", "value": img_base64.decode("utf-8")},
},
)
Expand Down

0 comments on commit f64d58c

Please sign in to comment.