kushajveersingh / resize_network_cv Goto Github PK
View Code? Open in Web Editor NEWPyTorch implementation of the paper "Learning to Resize Images for Computer Vision Tasks" on Imagenette and Imagewoof datasets
License: Apache License 2.0
PyTorch implementation of the paper "Learning to Resize Images for Computer Vision Tasks" on Imagenette and Imagewoof datasets
License: Apache License 2.0
The situation you mentioned are the input image and out image are the same Height and Width.
What about if we want different Height and width?
path = os.path.join(path, f"{cfg.data.name}.ckpt")
ckpt = torch.load(path)['state_dict']
The .ckpt file is not in the dataset I downloaded.
Where should I look for this file?Thanks!
def forward(self, x):
residual = self.interpolate(x)
out = self.module1(x)
out_residual = self.interpolate(out)
out = self.resblocks(out_residual)
out = self.module3(out)
out = out + out_residual
out = self.module4(out)
out = out + residual
return x
I found this bug by printing model summary.
The model should return out
instead of x
(the original input image).
https://github.com/KushajveerSingh/resize_network_cv/blob/main/src/models/resizer.py#L76
The original paper says:
... the proposed architecture allows for resizing an image to any target size and aspect ratio.
So the Resizer should handle input image with any aspect ratio.
In spite of that, the Resizer implementation (interpolation) seems to assume the input image is square (or, only handle uniform-scale resize: e.g. (512, 256) -> (256, 128)).
The current implementation interpolates by specifying scale_factor
, though I think it's more useful to specify the output image size and calculate scale factor automatically.
The reference code:
# current implementation
self.interpolate = partial(F.interpolate,
scale_factor=self.scale_factor,
mode=self.interpolate_mode,
align_corners=False,
recompute_scale_factor=False)
# suggestion
self.interpolate = partial(F.interpolate,
size=output_size,
mode=self.interpolate_mode,
align_corners=False)
c.f. https://github.com/KushajveerSingh/resize_network_cv/blob/main/src/models/resizer.py#L56-L60
I have run twice,one is follow you config,another is to extand the epoch,but the result is nothing different,
——————————————————
after try your config,the second try config is , ran the resize_net 800 epoch, learn rate step_size is 100,
and the fintune 50 epoch,but the result is the same,
is there any problem?thank you for your reply.
——————————————————
if needed, I will show the config
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.