# Does OpenMv IDE allow the importation of these python libaries?

**URL:** <https://forums.openmv.io/t/does-openmv-ide-allow-the-importation-of-these-python-libaries/9730>\
**Category:** OpenMV Boards\
**Created:** [June 23, 2024, 9:21am UTC](https://forums.openmv.io/t/does-openmv-ide-allow-the-importation-of-these-python-libaries/9730 "2024-06-23T09:21:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kremlin](https://avatars.discourse-cdn.com/v4/letter/k/a9adbd/32.png) [@kremlin](https://forums.openmv.io/u/kremlin)\
**Post date:** [June 23, 2024, 9:21am UTC](https://forums.openmv.io/t/does-openmv-ide-allow-the-importation-of-these-python-libaries/9730/1 "2024-06-23T09:21:49Z")

</div>

**import requests**

**import base64**

**from PIL import Image**

**from io import BytesIO**

project\_id = “drive-drowsiness-detection”

model\_version = 2

confidence = 0.5

iou\_thresh = 0.5

api\_key = “”

image\_url = “[https://t3.ftcdn.net/jpg/02/76/37/14/360\_F\_276371400\_t9dtc2OOXwcq7mEY1JTuNxdT06nf63Np.jpg](https://t3.ftcdn.net/jpg/02/76/37/14/360_F_276371400_t9dtc2OOXwcq7mEY1JTuNxdT06nf63Np.jpg)”

res = requests.post(

f"[https://detect.roboflow.com/{project\_id}/{model\_version}?api\_key={api\_key}&confidence={confidence}&overlap={iou\_thresh}&image={image\_url}](https://detect.roboflow.com/%7Bproject_id%7D/%7Bmodel_version%7D?api_key=%7Bapi_key%7D&confidence=%7Bconfidence%7D&overlap=%7Biou_thresh%7D&image=%7Bimage_url%7D)",

)

predictions = res.json()

print(predictions)

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [June 23, 2024, 2:19pm UTC](https://forums.openmv.io/t/does-openmv-ide-allow-the-importation-of-these-python-libaries/9730/2 "2024-06-23T14:19:17Z")

</div>

There’s no PIL module and BytesIO. The other modules have ports, see the documentation. See our Image module for our Image library.

You can use the to\_jpeg() in our Image module to convert an image to jpeg. Image objects all have buffer access so you can pass them base64 encoding.
