bo-zhang-cs / cacnet-pytorch Goto Github PK
View Code? Open in Web Editor NEWUnofficial PyTorch implementation of "Composing Photos Like a Photographer"
License: MIT License
Unofficial PyTorch implementation of "Composing Photos Like a Photographer"
License: MIT License
Thanks for providing the implementation. I have a query, in the steps you first mention 'python train_composition_classification.py' which saves the checkpoint in 'best_acc.pth'. Next, we run 'python train_image_cropping.py' which again saves different checkpoint. I can see these steps should be performed sequentially. So how is the checkpoint saved in best_acc.pth is used in the next module for image cropping? The script does not call for the previous weights to be loaded anywhere. Please help to clarify this. Thanks.
Line 173 in 440ccd1
for i in range(len(P_w)):
for j in range(len(P_h)):
anchors[k, 1] = P_w[j]
anchors[k, 0] = P_h[i]
k += 1
return anchors
TypeError: can't assign a numpy.int32 to a Variable[CPUType]
How to deal with it
Hi, thanks for your sharing awesome codes.
Dose your reproduced CACNet only normally run with the setting of keep_aspect_ratio=False
? I have tried to run with the setting of keep_aspect_ratio=True
and crop_batch_size=1
, however there encountered the following error, I want to know what cause it. Could you please share your perspectives about keep_aspect_ratio=True
? :-)
File "/root/CACNet/CACNet.py", line 194, in forward
regression[...,0::2] = offsets[..., 0::2] + self.all_anchors[...,0:1]
RuntimeError: The size of tensor a (44) must match the size of tensor b (28) at non-singleton dimension 2
How to run the test file and save the cropped image
Hello, can you share the original basic code?
Do you have any sample code to use pre-trained model to crop a single image input, or any suggestion ?
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.