diff --git a/README.md b/README.md index 3208e53..a349550 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,12 @@ This project hosts the testing code for CharNet, described in our paper: In: Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2019. +## Updates + +1. Added Visualization +2. icdar_2015 Test Dataset + + ## Installation ``` @@ -15,6 +21,10 @@ python setup.py build develop ``` +## Dataset +Download icdar_2015 Test Dataset [here](https://drive.google.com/file/d/1mPRmedDdC9UPlNQAEohMCMWlnTRoiqfC/view?usp=share_link) + + ## Run 1. Please run `bash download_weights.sh` to download our trained weights. 2. For ICDAR 2015, please run the following command line. Please replace `images_dir` with the directory containing ICDAR 2015 testing images. The results will be in `results_dir`. @@ -23,6 +33,10 @@ python setup.py build develop python tools/test_net.py configs/icdar2015_hourglass88.yaml ``` +## Results +![](https://github.com/hamzakhalil798/research-charnet/blob/master/images/result_1.jpg) +![](https://github.com/hamzakhalil798/research-charnet/blob/master/images/result_2.jpg) + ## Citation diff --git a/images/result_1.jpg b/images/result_1.jpg new file mode 100644 index 0000000..341fb1f Binary files /dev/null and b/images/result_1.jpg differ diff --git a/images/result_2.jpg b/images/result_2.jpg new file mode 100644 index 0000000..62a4724 Binary files /dev/null and b/images/result_2.jpg differ diff --git a/tools/test_net.py b/tools/test_net.py index 4b1ba58..19b2d80 100644 --- a/tools/test_net.py +++ b/tools/test_net.py @@ -22,6 +22,12 @@ def save_word_recognition(word_instances, image_id, save_root, separator=chr(31) fw.write(separator) fw.write(word_ins.text) fw.write('\n') + for word_ins in word_instances: + if len(word_ins.text) > 0: + bbox = word_ins.word_bbox.astype(np.int32) + cv2.rectangle(im_original, (bbox[0], bbox[1]), (bbox[4], bbox[5]), (0, 255, 0), 2) + cv2.putText(im_original, word_ins.text, (bbox[0], bbox[1]-10), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 255, 0), 2) + cv2.imwrite('{}/{}.jpg'.format(args.results_dir, os.path.splitext(im_name)[0]), im_original) def resize(im, size):