Comments (2)
from what i understood, they hardcoded the name GTA in their scripts
from photorealismenhancement.
Hey, alongside replacing with the _load_img
and applying torch.from_numpy()
, I also needed to permute channels accordingly, and in the end make cpu detach in matching/feature_based/sample_matches.py
. Below is my code:
for x in range(min(25,src_id.shape[0])):
i = int(rd[x])
print(f'\tloading sample {i}...')
#img, _ = src_dataset.get_by_path(src_paths[int(src_id[i])])
img = torch.from_numpy(src_dataset._load_img(src_paths[int(src_id[i])])).permute(2,0,1)
print("img size", img.size())
r0,r1,c0,c1 = src_coords[int(src_id[i])]
a = img[:,r0:r1,c0:c1].unsqueeze(0)
#img, _ = dst_dataset.get_by_path(dst_paths[int(dst_id[int(src_id[i]), int(knn[i])])])
img = torch.from_numpy(dst_dataset._load_img(dst_paths[int(dst_id[int(src_id[i]), int(knn[i])])])).permute(2,0,1)
r0,r1,c0,c1 = dst_coords[int(dst_id[int(src_id[i]), int(knn[i])])]
b = img[:,r0:r1,c0:c1].unsqueeze(0)
crops.append(a)
crops.append(b)
pass
if len(crops) > 0:
grid = make_grid(torch.cat(crops, 0), nrow=2)
some_arr = (255.0*grid.permute(1,2,0).cpu().detach().numpy()).astype(np.uint8)
print("some_arr shp:", some_arr.shape)
imwrite(f'knn_{t}.jpg', some_arr)
pass
pass
from photorealismenhancement.
Related Issues (20)
- Problem in training HOT 6
- Custom Robust Label Map HOT 1
- Can you provide a G-Buffer sample for correctness check
- Training Error HOT 16
- Robust label map HOT 4
- Inference of the same image is different with same settings HOT 1
- Max_iterations in test file
- What does "name_load" in test_pfd2cs.yaml mean? HOT 1
- How many images should I input? HOT 1
- Question HOT 2
- Training config for hr_new (ienet2.py) HOT 1
- How many GPUs used during training? HOT 1
- Struggling with a bit of the setup HOT 1
- Sigmoid missing in hr_new? HOT 2
- MSeg difficulties HOT 9
- Can't figure out how to compile it. HOT 2
- How to get the ground truth label map of GTA game? HOT 1
- Loading model for training HOT 2
- ValueError when saving model HOT 3
- RuntimeError while training HOT 3
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 photorealismenhancement.