Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
""" | ||
Use `python cv_dump.py` to create json file. | ||
Uninstall opencv-python before running this script. | ||
""" | ||
|
||
import paker | ||
import logging | ||
import numpy as np | ||
|
||
file = "cv2.json" | ||
logging.basicConfig(level=logging.NOTSET) | ||
|
||
if __name__ == '__main__': | ||
# read psutil code from json and load it using paker | ||
with open(file, "r") as f: | ||
with paker.load(f) as loader: | ||
import cv2 | ||
|
||
black = np.zeros([200, 250, 1], dtype="uint8") | ||
cv2.imshow("Black", black) | ||
|
||
cv2.waitKey(0) | ||
cv2.destroyAllWindows() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
""" | ||
Use this script to dump cv2 to JSON file. | ||
Make sure that opecv-python is installed. | ||
""" | ||
|
||
import cv2 | ||
import paker | ||
|
||
with open("cv2.json", "w+") as f: | ||
paker.dump(cv2, f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters