Giter VIP home page Giter VIP logo

artline's Introduction

ArtLine

You can sponsor me to support my open source work πŸ’– sponsor

The main aim of the project is to create amazing line art portraits.

Exciting update

ControlNet + ArtLine for portraits, Try colab!!

ControlNet + ArtLine

The model is designed to take in a portrait image and a corresponding written instruction, and then use that instruction to adjust the style of the image.

model

model

model

Shahrukh

Highlights

Example Images

bohemian rhapsody movie , Rami Malek American actor

bohemian

Photo by Maxim from Pexels

Imgur

Keanu Reeves, Canadian actor.

Keanu

Photo by Anastasiya Gepp from Pexels

Imgur

Interstellar

Interstellar

Pexels Portrait, Model

Imgur

BeyoncΓ©, American singer

BeyoncΓ©

Model-(Smooth)

Model-(Quality)

Open in RunwayML Badge

Click on the below image to know more about colab demo, credits to Bhavesh Bhatt for the amazing Youtube video.

Line Art

The amazing results that the model has produced has a secret sauce to it. The initial model couldn't create the sort of output I was expecting, it mostly struggled with recognizing facial features. Even though (https://github.com/yiranran/APDrawingGAN) produced great results it had limitations like (frontal face photo similar to ID photo, preferably with clear face features, no glasses and no long fringe.) I wanted to break-in and produce results that could recognize any pose. Achieving proper lines around the face, eyes, lips and nose depends on the data you give the model. APDrawing dataset alone was not enough so I had to combine selected photos from Anime sketch colorization pair dataset. The combined dataset helped the model to learn the lines better.

Movie Poster created using ArtLine.

The movie poster was created using ArtLine in no time , it's not as good as it should be but I'm not an artist.

Poster

Poster

Technical Details

Surprise!! No critic,No GAN. GAN did not make much of a difference so I was happy with No GAN.

The mission was to create something that converts any personal photo into a line art. The initial efforts have helped to recognize lines, but still the model has to improve a lot with shadows and clothes. All my efforts are to improve the model and make line art a click away.

Imgur

Dataset

APDrawing dataset

Anime sketch colorization pair dataset

APDrawing data set consits of mostly close-up portraits so the model would struggle to recogonize cloths,hands etc. For this purpose selected images from Anime sketch colorization pair were used.

Going Forward

I hope I was clear, going forward would like to improve the model further as it still struggles with random backgrounds(I'm creating a custom dataset to address this issue).

I will be constantly upgrading the project for the foreseeable future.

Getting Started Yourself

The easiest way to get started is to simply try out on Colab: https://colab.research.google.com/github/vijishmadhavan/Light-Up/blob/master/ArtLine(Try_it_on_Colab).ipynb

Installation Details

This project is built around the wonderful Fast.AI library.

  • fastai==1.0.61 (and its dependencies). Please dont install the higher versions
  • PyTorch 1.6.0 Please don't install the higher versions

Limitations

  • Getting great output depends on Lighting, Backgrounds,Shadows and the quality of photos. You'll mostly get good results in the first go but there are chances for issues as well. The model is not there yet, it still needs to be tweaked to reach out to all the consumers. It might be useful for "AI Artisits/ Artists who can bring changes to the final output.

  • The model confuses shadows with hair, something that I'm trying to solve.

  • It does bad with low quality images(below 500px).

  • I'm not a coder, bear with me for the bad code and documentation. Will make sure that I improve with upcoming updates.

Updates

Get more updates on Twitter

Mail me @ [email protected]

Acknowledgments

License

All code in this repository is under the MIT license as specified by the LICENSE file.

artline's People

Contributors

ak9250 avatar vijishmadhavan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

artline's Issues

Packages version are not ok

Hello,
pip install runway-python fastai==1.0.61 numpy==1.17.2 pandas==1.1.2 torch==1.6.0 torchvision===0.7.0 fails.
Some versions need update. Could you fix it please ?

Thank you.

SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xb3

Python 3.9

ERROR: Command errored out with exit status 1: command: 'E:\python_projects\ArtLine\.venv\Scripts\python.exe' 'E:\python_projects\ArtLine\.venv\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\PAWE~1\AppData\Local\Temp\tmph2xvoder' cwd: C:\Users\PaweΕ‚\AppData\Local\Temp\pip-install-68zlosqp\bottleneck Complete output (57 lines): running dist_info creating C:\Users\PaweΕ‚\AppData\Local\Temp\pip-install-68zlosqp\bottleneck\pip-wheel-metadata\Bottleneck.egg-info writing C:\Users\PaweΕ‚\AppData\Local\Temp\pip-install-68zlosqp\bottleneck\pip-wheel-metadata\Bottleneck.egg-info\PKG-INFO writing dependency_links to C:\Users\PaweΕ‚\AppData\Local\Temp\pip-install-68zlosqp\bottleneck\pip-wheel-metadata\Bottleneck.egg-info\dependency_links.txt writing requirements to C:\Users\PaweΕ‚\AppData\Local\Temp\pip-install-68zlosqp\bottleneck\pip-wheel-metadata\Bottleneck.egg-info\requires.txt writing top-level names to C:\Users\PaweΕ‚\AppData\Local\Temp\pip-install-68zlosqp\bottleneck\pip-wheel-metadata\Bottleneck.egg-info\top_level.txt writing manifest file 'C:\Users\PaweΕ‚\AppData\Local\Temp\pip-install-68zlosqp\bottleneck\pip-wheel-metadata\Bottleneck.egg-info\SOURCES.txt' Error in sitecustomize; set PYTHONVERBOSE for traceback: SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xb3 in position 0: invalid start byte (sitecustomize.py, line 21) Traceback (most recent call last): File "E:\python_projects\ArtLine\.venv\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 207, in <module> main() File "E:\python_projects\ArtLine\.venv\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 197, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "E:\python_projects\ArtLine\.venv\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 69, in prepare_metadata_for_build_wheel return hook(metadata_directory, config_settings) File "E:\python_projects\ArtLine\.venv\lib\site-packages\setuptools\build_meta.py", line 156, in prepare_metadata_for_build_wheel self.run_setup() File "E:\python_projects\ArtLine\.venv\lib\site-packages\setuptools\build_meta.py", line 236, in run_setup super(_BuildMetaLegacyBackend, File "E:\python_projects\ArtLine\.venv\lib\site-packages\setuptools\build_meta.py", line 142, in run_setup exec(compile(code, __file__, 'exec'), locals()) File "setup.py", line 196, in <module> setup(**metadata) File "E:\python_projects\ArtLine\.venv\lib\site-packages\setuptools\__init__.py", line 145, in setup return distutils.core.setup(**attrs) File "C:\Python38\lib\distutils\core.py", line 148, in setup dist.run_commands() File "C:\Python38\lib\distutils\dist.py", line 966, in run_commands self.run_command(cmd) File "C:\Python38\lib\distutils\dist.py", line 985, in run_command cmd_obj.run() File "E:\python_projects\ArtLine\.venv\lib\site-packages\setuptools\command\dist_info.py", line 31, in run egg_info.run() File "E:\python_projects\ArtLine\.venv\lib\site-packages\setuptools\command\egg_info.py", line 296, in run self.find_sources() File "E:\python_projects\ArtLine\.venv\lib\site-packages\setuptools\command\egg_info.py", line 303, in find_sources mm.run() File "E:\python_projects\ArtLine\.venv\lib\site-packages\setuptools\command\egg_info.py", line 534, in run self.add_defaults() File "E:\python_projects\ArtLine\.venv\lib\site-packages\setuptools\command\egg_info.py", line 570, in add_defaults sdist.add_defaults(self) File "C:\Python38\lib\distutils\command\sdist.py", line 228, in add_defaults self._add_defaults_ext() File "C:\Python38\lib\distutils\command\sdist.py", line 311, in _add_defaults_ext build_ext = self.get_finalized_command('build_ext') File "C:\Python38\lib\distutils\cmd.py", line 299, in get_finalized_command cmd_obj.ensure_finalized() File "C:\Python38\lib\distutils\cmd.py", line 107, in ensure_finalized self.finalize_options() File "setup.py", line 75, in finalize_options import numpy File "E:\python_projects\ArtLine\.venv\lib\site-packages\numpy\__init__.py", line 305, in <module> _win_os_check() File "E:\python_projects\ArtLine\.venv\lib\site-packages\numpy\__init__.py", line 302, in _win_os_check raise RuntimeError(msg.format(__file__)) from None RuntimeError: The current Numpy installation ('E:\\python_projects\\ArtLine\\.venv\\lib\\site-packages\\numpy\\__init__.py') fails to pass a sanity check due to a bug in the windows runtime. See this issue for more information: https://tinyurl.com/y3dm3h86 ---------------------------------------- ERROR: Command errored out with exit status 1: 'E:\python_projects\ArtLine\.venv\Scripts\python.exe' 'E:\python_projects\ArtLine\.venv\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\PAWE~1\AppData\Local\Temp\tmph2xvoder' Check the logs for full command output.

Model results observer

Hi!

I would like to share one small tool that you may found useful. Right now I use it to compare differences between u2net and artline, it allows to quickly switch between two or more models and observe the differences (keys 2, 3).

Interactive version here

It uses ffhq as dataset

Could not install bottleneck

Hello! When I use the requirements.txt to install libraries, it failed with the error:
ERROR:Could not build wheels for bottleneck which use PEP 517 and cannot be installed directly
Could you please tell me how to fix it? Thank you!
The whole error messages are as below:

ERROR: Command errored out with exit status 1:
command: /home/tigershan/anaconda3/envs/ArtLine/bin/python /home/tigershan/anaconda3/envs/ArtLine/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmp3rj4usov
cwd: /tmp/pip-install-ne7kzdj5/bottleneck_4132ceeb7f0a474ca245fb029b472ac0
Complete output (122 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/bottleneck
copying bottleneck/init.py -> build/lib.linux-x86_64-3.7/bottleneck
copying bottleneck/_version.py -> build/lib.linux-x86_64-3.7/bottleneck
copying bottleneck/_pytesttester.py -> build/lib.linux-x86_64-3.7/bottleneck
creating build/lib.linux-x86_64-3.7/bottleneck/tests
copying bottleneck/tests/move_test.py -> build/lib.linux-x86_64-3.7/bottleneck/tests
copying bottleneck/tests/init.py -> build/lib.linux-x86_64-3.7/bottleneck/tests
copying bottleneck/tests/nonreduce_test.py -> build/lib.linux-x86_64-3.7/bottleneck/tests
copying bottleneck/tests/input_modification_test.py -> build/lib.linux-x86_64-3.7/bottleneck/tests
copying bottleneck/tests/nonreduce_axis_test.py -> build/lib.linux-x86_64-3.7/bottleneck/tests
copying bottleneck/tests/reduce_test.py -> build/lib.linux-x86_64-3.7/bottleneck/tests
copying bottleneck/tests/list_input_test.py -> build/lib.linux-x86_64-3.7/bottleneck/tests
copying bottleneck/tests/memory_test.py -> build/lib.linux-x86_64-3.7/bottleneck/tests
copying bottleneck/tests/util.py -> build/lib.linux-x86_64-3.7/bottleneck/tests
copying bottleneck/tests/scalar_input_test.py -> build/lib.linux-x86_64-3.7/bottleneck/tests
creating build/lib.linux-x86_64-3.7/bottleneck/src
copying bottleneck/src/bn_template.py -> build/lib.linux-x86_64-3.7/bottleneck/src
copying bottleneck/src/init.py -> build/lib.linux-x86_64-3.7/bottleneck/src
copying bottleneck/src/bn_config.py -> build/lib.linux-x86_64-3.7/bottleneck/src
creating build/lib.linux-x86_64-3.7/bottleneck/benchmark
copying bottleneck/benchmark/init.py -> build/lib.linux-x86_64-3.7/bottleneck/benchmark
copying bottleneck/benchmark/autotimeit.py -> build/lib.linux-x86_64-3.7/bottleneck/benchmark
copying bottleneck/benchmark/bench.py -> build/lib.linux-x86_64-3.7/bottleneck/benchmark
copying bottleneck/benchmark/bench_detailed.py -> build/lib.linux-x86_64-3.7/bottleneck/benchmark
creating build/lib.linux-x86_64-3.7/bottleneck/slow
copying bottleneck/slow/init.py -> build/lib.linux-x86_64-3.7/bottleneck/slow
copying bottleneck/slow/move.py -> build/lib.linux-x86_64-3.7/bottleneck/slow
copying bottleneck/slow/reduce.py -> build/lib.linux-x86_64-3.7/bottleneck/slow
copying bottleneck/slow/nonreduce.py -> build/lib.linux-x86_64-3.7/bottleneck/slow
copying bottleneck/slow/nonreduce_axis.py -> build/lib.linux-x86_64-3.7/bottleneck/slow
UPDATING build/lib.linux-x86_64-3.7/bottleneck/_version.py
set build/lib.linux-x86_64-3.7/bottleneck/_version.py to '1.3.2'
running build_ext
running config
compiling '_configtest.c':

#pragma GCC diagnostic error "-Wattributes"

int attribute((optimize("O3"))) have_attribute_optimize_opt_3(void*);

int main(void)
{
return 0;
}

gcc -pthread -B /home/tigershan/anaconda3/envs/ArtLine/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -c _configtest.c -o _configtest.o
failure.
removing: _configtest.c _configtest.o
compiling '_configtest.c':

#ifndef __cplusplus
static inline int static_func (void)
{
return 0;
}
inline int nostatic_func (void)
{
return 0;
}
#endif
int main(void) {
int r1 = static_func();
int r2 = nostatic_func();
return r1 + r2;
}

gcc -pthread -B /home/tigershan/anaconda3/envs/ArtLine/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -c _configtest.c -o _configtest.o
failure.
removing: _configtest.c _configtest.o
compiling '_configtest.c':

#ifndef __cplusplus
static inline int static_func (void)
{
return 0;
}
inline int nostatic_func (void)
{
return 0;
}
#endif
int main(void) {
int r1 = static_func();
int r2 = nostatic_func();
return r1 + r2;
}

gcc -pthread -B /home/tigershan/anaconda3/envs/ArtLine/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -c _configtest.c -o _configtest.o
failure.
removing: _configtest.c _configtest.o
compiling '_configtest.c':

#ifndef __cplusplus
static __inline int static_func (void)
{
return 0;
}
__inline int nostatic_func (void)
{
return 0;
}
#endif
int main(void) {
int r1 = static_func();
int r2 = nostatic_func();
return r1 + r2;
}

gcc -pthread -B /home/tigershan/anaconda3/envs/ArtLine/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -c _configtest.c -o _configtest.o
failure.
removing: _configtest.c configtest.o
building 'bottleneck.reduce' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/bottleneck
creating build/temp.linux-x86_64-3.7/bottleneck/src
gcc -pthread -B /home/tigershan/anaconda3/envs/ArtLine/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/tmp/pip-build-env-ryeao30
/overlay/lib/python3.7/site-packages/numpy/core/include -I/home/tigershan/anaconda3/envs/ArtLine/include/python3.7m -Ibottleneck/src -c bottleneck/src/reduce.c -o build/temp.linux-x86_64-3.7/bottleneck/src/reduce.o -O2
error: command 'gcc' failed with exit status 1

ERROR: Failed building wheel for bottleneck
Failed to build bottleneck
ERROR: Could not build wheels for bottleneck which use PEP 517 and cannot be installed directly

Memory leak bug

Hello vijishmadhavan:

After I run step p,img_hr,b = model.predict(img_fast), memory will increase 10M。
As long as you keep running, the memory will keep increasing, so I think it is memory leak.

Please help me, Thank you very much!

I Don't Know What I'm Doing

I'm new to GitHub and use it mainly for playing games, but I don't know how to get the link to a game right from GitHub. All I want to do is play a video game from this website during winter break, yet I don't know how. Can someone help me please?

how to train you model ?

Sir , Can you tell me which this dataset link ?

`path = Path('/content/gdrive/My Drive/Apdrawing')

Blended Facial Features

path_hr = Path('/content/gdrive/My Drive/Apdrawing/draw tiny')
path_lr = Path('/content/gdrive/My Drive/Apdrawing/Tiny Real')

Portrait Pair

path_hr3 = Path('/content/gdrive/My Drive/Apdrawing/drawing')
path_lr3= Path('/content/gdrive/My Drive/Apdrawing/Real')`

Save instead of show?

Im looking to have the colab save the file instead of show it inline. I've got it working somewhat, but the saved image is "inverted".
Any hints on getting the image to save nicely?

Keeping same aspect ration in output

Hi, great work!
This is looks better than APDrawingGAN2 and U-2-Net.
Can you alter the code so it keeps the original aspect ratio and resolution for output image?

How to load model on Flask app?

I've got this working on the Google collab document, but am running into issues with Flask with the error AttributeError: Can't get attribute 'FeatureLoss' on <module '__main__' from '/home/ubuntu/anaconda3/bin/flask'>. I believe this is related to https://discuss.pytorch.org/t/error-loading-saved-model/8371 and https://stackoverflow.com/questions/27732354/unable-to-load-files-using-pickle-and-multiple-modules where some solutions have been suggested, but I can't work out how to get it working in this case.

Basic Flask app (this is of course incomplete, but throws the AttributeError error when trying to load the model):

from flask import Flask
app = Flask(__name__)

import fastai
import time
from fastai.vision import *
from fastai.utils.mem import *
from fastai.vision import open_image, load_learner, image, torch
import numpy as np
import urllib.request
import PIL.Image
from io import BytesIO
import torchvision.transforms as T
from PIL import Image
import requests
from io import BytesIO
import fastai
from fastai.vision import *
from fastai.utils.mem import *
from fastai.vision import open_image, load_learner, image, torch
import numpy as np
import urllib.request
import PIL.Image
from io import BytesIO
import torchvision.transforms as T

class FeatureLoss(nn.Module):
    def __init__(self, m_feat, layer_ids, layer_wgts):
        super().__init__()
        self.m_feat = m_feat
        self.loss_features = [self.m_feat[i] for i in layer_ids]
        self.hooks = hook_outputs(self.loss_features, detach=False)
        self.wgts = layer_wgts
        self.metric_names = ['pixel',] + [f'feat_{i}' for i in range(len(layer_ids))
              ] + [f'gram_{i}' for i in range(len(layer_ids))]
    def make_features(self, x, clone=False):
        self.m_feat(x)
        return [(o.clone() if clone else o) for o in self.hooks.stored]
    def forward(self, input, target):
        out_feat = self.make_features(target, clone=True)
        in_feat = self.make_features(input)
        self.feat_losses = [base_loss(input,target)]
        self.feat_losses += [base_loss(f_in, f_out)*w
                             for f_in, f_out, w in zip(in_feat, out_feat, self.wgts)]
        self.feat_losses += [base_loss(gram_matrix(f_in), gram_matrix(f_out))*w**2 * 5e3
                             for f_in, f_out, w in zip(in_feat, out_feat, self.wgts)]
        self.metrics = dict(zip(self.metric_names, self.feat_losses))
        return sum(self.feat_losses)
    def __del__(self): self.hooks.remove()

path = Path(".")
learn=load_learner(path, 'ArtLine_650.pkl')

@app.route("/", methods=["POST"])
def home():
    # take user's sent image and turn it into line drawing
    return ''

if __name__ == '__main__':

    app.run(debug = True)

How would I get this working with Flask?

how to train your model?

how to train your model?
The data set is not given。

Blended Facial Features

path_hr = Path('/content/gdrive/My Drive/Apdrawing/draw tiny')
path_lr = Path('/content/gdrive/My Drive/Apdrawing/Tiny Real')

Portrait Pair

path_hr3 = Path('/content/gdrive/My Drive/Apdrawing/drawing')
path_lr3= Path('/content/gdrive/My Drive/Apdrawing/Real')

subprocess-exited-with-error

hi!so thankful for your exciting work! I had a problem when I ran it in colab and don't know how to deal with it. Could you give me some advice?
when I run !pip install -r colab_requirements.txt:
Collecting fastai==1.0.61 (from -r colab_requirements.txt (line 1))
Downloading fastai-1.0.61-py3-none-any.whl (239 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 239.2/239.2 kB 4.8 MB/s eta 0:00:00
Collecting numpy==1.17.2 (from -r colab_requirements.txt (line 2))
Downloading numpy-1.17.2.zip (6.5 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.5/6.5 MB 43.7 MB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Collecting pandas==1.1.2 (from -r colab_requirements.txt (line 3))
Downloading pandas-1.1.2.tar.gz (5.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.2/5.2 MB 99.7 MB/s eta 0:00:00
error: subprocess-exited-with-error

Γ— pip subprocess to install build dependencies did not run successfully.
β”‚ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Installing build dependencies ... error
error: subprocess-exited-with-error

Γ— pip subprocess to install build dependencies did not run successfully.
β”‚ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

get_gradient when training

In your trainning code, you use the below function to preprocess the training data.

def get_data(bs,size):
    data = (src.label_from_func(lambda x: path_hr/x.name)
           .transform(get_transforms(xtra_tfms=[gradient()]), size=size, tfm_y=True)
           .databunch(bs=bs,num_workers = 0).normalize(imagenet_stats, do_y=True))
    data.c = 3
    return data

I'm just wondering if you are calculating gradient images for both the input and target images. Does this mean the network you are training also takes a gradient image as input and generates a gradient image as the output? If so how do you get the final results from the output gradient image?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.