Comments (6)
you can use the code from InstColorization/InstColorization.ipynb
from google.colab.patches import cv2_imshow
img_name_list = ['000000022969', '000000023781', '000000046872', '000000050145']
show_index = 1
img = cv2.imread('example/'+img_name_list[show_index]+'.jpg')
lab_image = cv2.cvtColor(img, cv2.COLOR_BGR2LAB)
l_channel, _, _ = cv2.split(lab_image)
img = cv2.imread('results/'+img_name_list[show_index]+'.png')
lab_image = cv2.cvtColor(img, cv2.COLOR_BGR2LAB)
_, a_pred, b_pred = cv2.split(lab_image)
a_pred = cv2.resize(a_pred, (l_channel.shape[1], l_channel.shape[0]))
b_pred = cv2.resize(b_pred, (l_channel.shape[1], l_channel.shape[0]))
gray_color = np.ones_like(a_pred) * 128
gray_image = cv2.cvtColor(np.stack([l_channel, gray_color, gray_color], 2), cv2.COLOR_LAB2BGR)
color_image = cv2.cvtColor(np.stack([l_channel, a_pred, b_pred], 2), cv2.COLOR_LAB2BGR)
cv2_imshow(np.concatenate([gray_image, color_image], 1))
from instcolorization.
I got the same problem when I run python test_fusion.py --name test_fusion --sample_p 1.0 --model fusion --fineSize 512 --test_img_dir example --results_img_dir results
at colab.
I can only use the fineSize 256 to test the effect, the colorization is so great but the image was compressed and cropped.
from instcolorization.
Our model colorizes every instance in the image, so it would take large amount of vram, so colorizing small image and attach color channel onto original gray image (see the least block of colab notebook) would be one acceptable method to colorize high resolution image.
from instcolorization.
Hi,
Please forgive me re-asking the same questions, I'm not clear about the answer yet.
Your Git page and read-me have been easy to follow and I can get small square cropped color results from my PC, that look great, (thank you!)
I am aiming to get color pictures the same size (and ratio) as the original gray ones from my home PC. I think you are saying I would need a lot of memory on my GPU to do this and my 6GB GPU is not enough.
But I think you are saying there is away around this problem..... "so colorizing small image and attach color channel onto original gray image would be one acceptable method to colorize high resolution image."
Are there any steps you could share with me that I can use on my home PC to do this? Ive looked at the last block of code on the colab but have not been able to use this in my conda environment. Thanks.
from instcolorization.
from instcolorization.
I think it will be great if somehow the code suggested by @onefish51 be merged into the https://github.com/ericsujw/InstColorization/blob/master/test_fusion.py
from instcolorization.
Related Issues (20)
- [Detectron2] RuntimeError: CUDA error: no kernel image is available for execution on the device HOT 1
- How to achieve your test result on ImageNet?
- train very slow
- Color normalization
- Prediction on full size image without transformation ? HOT 2
- FileNotFoundError: [Errno 2] No such file or directory: 'checkpoints/coco_finetuned_mask_256_ffs
- Why are the output images very blurred and the resolution is very low?
- I can not enter into http://localhost:8098.
- When I use my datasets to train, I meet so many error in test
- Model parameters and FLOPs?
- What is the difference between the provided model weights: "coco_finetuned_mask_256_ffs" and "coco_finetuned_mask_256"
- Checkpoints and COCOStuff setting
- Model weights without finetuning on COCO-Stuff.
- Model weights without finetuning on COCO-Stuff.
- PSNR and SSIM evalution question
- How to color if there is no instance
- Download the Model
- mask_list.append(pred_bg_mask + (1 - mask_sum_for_pred) * 100000.0)
- Colab notebook doesn't work
- detection2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from instcolorization.