Skip to content

Commit 039c5e6

Browse files
committed
Adding README for documentation about how to run datagen script
1 parent 70cfbbc commit 039c5e6

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

tools/datagen/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# **SystemC Image Data Generation Tool for Project Testbench**
2+
3+
This tool will help to generate the required data for the testbench. It
4+
generates grayscale, Sobel x, Sobel y, and combined Sobel x-y images.
5+
6+
7+
## **Installation**
8+
9+
Before running, make sure you have installed Python OpenCV. You can run:
10+
```shell
11+
cd tools/datagen/
12+
chmod +x install_pyopencv.sh
13+
./install_pyopencv.sh
14+
```
15+
16+
It will display the OpenCV version at the end of the installation.
17+
18+
19+
## **Usage**
20+
21+
There are two versions of the script, a JupyterNotebook and a normal Python
22+
script. For both of them, in the main function, the variables `img_name` and
23+
`img_ext` must be updated. The `img_name` is only the name of the image that
24+
is saved in `tools/datagen/src/imgs` and the `img_ext` is the extension of the
25+
image. For instance:
26+
27+
```python
28+
img_name: str = 'car'
29+
img_ext: str = 'jpg
30+
```
31+
32+
will load `tools/datagen/src/imgs/car.jpg` image and generate:
33+
34+
* tools/datagen/src/imgs/car\_grayscale\_image.jpg
35+
* tools/datagen/src/imgs/car\_sobel\_combined\_result.jpg
36+
* tools/datagen/src/imgs/car\_sobel\_x\_result.jpg
37+
* tools/datagen/src/imgs/car\_sobel\_y\_result.jpg
38+
39+
These generated images are ignored and must not be committed to the repository.
40+
41+
42+
### **Python Script**
43+
44+
To run the Python script:
45+
46+
```shell
47+
cd tools/datagen/
48+
python3 datagen.py
49+
```
50+
51+
52+
### **JupyterNotebook**
53+
54+
You can open the file from the JupyterNotebook app or upload it to
55+
[Google Colab](https://colab.research.google.com/).
56+

0 commit comments

Comments
 (0)