Runnable Python demo of ArtLine

Overview

artline-demo

How to run?

  1. pip3 install -r requirements.txt
  2. python3 app.py

How to use?

  1. Run the Flask app
  2. Open localhost:5000 in browser
  3. Select an image( .png or .jpg ) then click Go Art
  4. Once the process done successfully, you should see the result in browser.

Enjoy and give a star if you like it.

Comments
  • python3.9 pip3 install -r requirements.txt Error

    python3.9 pip3 install -r requirements.txt Error

    Error information

    pip3 install -r requirements.txt

    ERROR: Could not find a version that satisfies the requirement torch==1.6.0 ERROR: No matching distribution found for torch==1.6.0

    Please advise me

    thanks very much!

    opened by chosen1cwp 2
  • Can't run on macos with the below error

    Can't run on macos with the below error

    Traceback (most recent call last): File "app.py", line 29, in pl.load_pkl() File "app.py", line 24, in load_pkl learn = load_learner(path, 'ArtLine_650.pkl') File "/usr/local/lib/python3.7/site-packages/fastai/basic_train.py", line 621, in load_learner state = torch.load(source, map_location='cpu') if defaults.device == torch.device('cpu') else torch.load(source) File "/usr/local/lib/python3.7/site-packages/torch/serialization.py", line 571, in load with _open_file_like(f, 'rb') as opened_file: File "/usr/local/lib/python3.7/site-packages/torch/serialization.py", line 229, in _open_file_like return _open_file(name_or_buffer, mode) File "/usr/local/lib/python3.7/site-packages/torch/serialization.py", line 210, in init super(_open_file, self).init(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: 'ArtLine_650.pkl'

    opened by medoer 2
  • No such file or directory: 'ArtLine_650.pkl

    No such file or directory: 'ArtLine_650.pkl

    File "app.py", line 29, in pl.load_pkl() File "app.py", line 24, in load_pkl learn = load_learner(path, 'ArtLine_650.pkl') File "/usr/local/lib/python3.6/site-packages/fastai/basic_train.py", line 621, in load_learner state = torch.load(source, map_location='cpu') if defaults.device == torch.device('cpu') else torch.load(source) File "/usr/local/lib/python3.6/site-packages/torch/serialization.py", line 571, in load with _open_file_like(f, 'rb') as opened_file: File "/usr/local/lib/python3.6/site-packages/torch/serialization.py", line 229, in _open_file_like return _open_file(name_or_buffer, mode) File "/usr/local/lib/python3.6/site-packages/torch/serialization.py", line 210, in init super(_open_file, self).init(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: 'ArtLine_650.pkl'

    opened by xwdg 1
  • FileNotFoundError: [Errno 2] No such file or directory: 'ArtLine_650.pkl'

    FileNotFoundError: [Errno 2] No such file or directory: 'ArtLine_650.pkl'

    ~/share/artline-demo$ python3 app.py Traceback (most recent call last): File "app.py", line 29, in pl.load_pkl() File "app.py", line 24, in load_pkl learn = load_learner(path, 'ArtLine_650.pkl') File "/home/mo/.local/lib/python3.6/site-packages/fastai/basic_train.py", line 621, in load_learner state = torch.load(source, map_location='cpu') if defaults.device == torch.device('cpu') else torch.load(source) File "/home/mo/.local/lib/python3.6/site-packages/torch/serialization.py", line 571, in load with _open_file_like(f, 'rb') as opened_file: File "/home/mo/.local/lib/python3.6/site-packages/torch/serialization.py", line 229, in _open_file_like return _open_file(name_or_buffer, mode) File "/home/mo/.local/lib/python3.6/site-packages/torch/serialization.py", line 210, in init super(_open_file, self).init(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: 'ArtLine_650.pkl'

    opened by aaaaaaaaala 1
  • No such file or directory: 'ArtLine_650.pkl'

    No such file or directory: 'ArtLine_650.pkl'

    artline-demo git:(main) ✗ python app.py Traceback (most recent call last): File "app.py", line 29, in pl.load_pkl() File "app.py", line 24, in load_pkl learn = load_learner(path, 'ArtLine_650.pkl') File "/Users/lgq/.local/share/virtualenvs/artline-demo-gL78j4yU/lib/python3.7/site-packages/fastai/basic_train.py", line 621, in load_learner state = torch.load(source, map_location='cpu') if defaults.device == torch.device('cpu') else torch.load(source) File "/Users/lgq/.local/share/virtualenvs/artline-demo-gL78j4yU/lib/python3.7/site-packages/torch/serialization.py", line 571, in load with _open_file_like(f, 'rb') as opened_file: File "/Users/lgq/.local/share/virtualenvs/artline-demo-gL78j4yU/lib/python3.7/site-packages/torch/serialization.py", line 229, in _open_file_like return _open_file(name_or_buffer, mode) File "/Users/lgq/.local/share/virtualenvs/artline-demo-gL78j4yU/lib/python3.7/site-packages/torch/serialization.py", line 210, in init super(_open_file, self).init(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: 'ArtLine_650.pkl'

    opened by awolfly9 1
  • FileNotFoundError: [Errno 2] No such file or directory: 'tmp/de15864d535c11eb876680fa5b60bc61.png'

    FileNotFoundError: [Errno 2] No such file or directory: 'tmp/de15864d535c11eb876680fa5b60bc61.png'

    At last I have configured the environment successfully, and I accessed localhost:5000 and upload a picture. Then I pressed the go art button, an unexpected error occurred:

    FileNotFoundError: [Errno 2] No such file or directory: 'tmp/0a520bff535e11ebbe7680fa5b60bc61.png'

    Traceback (most recent call last) File "D:\Anaconda\envs\py37\lib\site-packages\flask\app.py", line 2464, in call return self.wsgi_app(environ, start_response) File "D:\Anaconda\envs\py37\lib\site-packages\flask\app.py", line 2450, in wsgi_app response = self.handle_exception(e) File "D:\Anaconda\envs\py37\lib\site-packages\flask\app.py", line 1867, in handle_exception reraise(exc_type, exc_value, tb) File "D:\Anaconda\envs\py37\lib\site-packages\flask_compat.py", line 39, in reraise raise value File "D:\Anaconda\envs\py37\lib\site-packages\flask\app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "D:\Anaconda\envs\py37\lib\site-packages\flask\app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "D:\Anaconda\envs\py37\lib\site-packages\flask\app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File "D:\Anaconda\envs\py37\lib\site-packages\flask_compat.py", line 39, in reraise raise value File "D:\Anaconda\envs\py37\lib\site-packages\flask\app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "D:\Anaconda\envs\py37\lib\site-packages\flask\app.py", line 1936, in dispatch_request return self.view_functionsrule.endpoint File "F:\WorkPlace\artline-demo\artline-demo\app.py", line 76, in result_view f.save(local_file) File "D:\Anaconda\envs\py37\lib\site-packages\werkzeug\datastructures.py", line 3066, in save dst = open(dst, "wb") FileNotFoundError: [Errno 2] No such file or directory: 'tmp/0a520bff535e11ebbe7680fa5b60bc61.png'

    I want to know how to solve this error.

    opened by alexitive 0
  • Python 3.6.8  install error

    Python 3.6.8 install error

    No matching distribution found for blis<0.8.0,>=0.4.0 Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/setuptools/installer.py", line 128, in fetch_build_egg

    opened by drduan 1
  • Can't get attribute 'FeatureLoss' on <module '__main__' (built-in)>

    Can't get attribute 'FeatureLoss' on

    Thank you very much for your resources. In Linux environment, Uwsgi deployment, error still occurs: ** Starting uWSGI 2.0.19.1 (64bit) on [Thu Dec 31 18:07:43 2020] *** compiled with version: 5.4.0 20160609 on 17 December 2020 08:16:00 os: Linux-4.4.0-198-generic #230-Ubuntu SMP Sat Nov 28 01:30:29 UTC 2020 nodename: 10-9-60-142 machine: x86_64 clock source: unix pcre jit disabled detected number of CPU cores: 4 current working directory: /home/ubuntu/chengping/artline-demo-main writing pidfile to uwsgi.pid detected binary path: /home/ubuntu/songcheng/venv3.0/bin/uwsgi uWSGI running as root, you can use --uid/--gid/--chroot options *** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** chdir() to /home/ubuntu/chengping/artline-demo-main/ your processes number limit is 63944 your memory page size is 4096 bytes detected max file descriptor number: 1000000 lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) uwsgi socket 0 bound to TCP address 0.0.0.0:5000 fd 3 uWSGI running as root, you can use --uid/--gid/--chroot options *** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** Python version: 3.7.1 (default, Dec 17 2020, 15:23:31) [GCC 5.4.0 20160609] Set PythonHome to /home/ubuntu/songcheng/venv3.0/ Python main interpreter initialized at 0xc51680 uWSGI running as root, you can use --uid/--gid/--chroot options *** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** python threads support enabled your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds mapped 145840 bytes (142 KB) for 1 cores *** Operational MODE: single process *** uWSGI running as root, you can use --uid/--gid/--chroot options *** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 14225) spawned uWSGI worker 1 (pid: 14226, cores: 1) *** Stats server enabled on 0.0.0.0:8383 fd: 9 *** Traceback (most recent call last): File "./app_cpu.py", line 76, in state = torch.load('ArtLine_650.pkl', map_location='cpu') if defaults.device == torch.device('cpu') else torch.load(source) File "/home/ubuntu/venv3.0/lib/python3.7/site-packages/torch/serialization.py", line 584, in load return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args) File "/home/ubuntu/venv3.0/lib/python3.7/site-packages/torch/serialization.py", line 842, in _load result = unpickler.load() AttributeError: Can't get attribute 'FeatureLoss' on <module 'main' (built-in)> unable to load app 0 (mountpoint='') (callable not found or import error) *** no app loaded. going in full dynamic mode ***

    but, In the same situation, I can run my service in Python.

    opened by applech666 3
Releases(v0.1.0)
Owner
Jiang Wenjian
A good code is like a story, not a puzzle.
Jiang Wenjian
Demo Python project using Conda and Poetry

Conda Poetry This is a demonstration of how Conda and Poetry can be used in a Python project for dev dependency management and production deployment.

Ryan Allen 2 Apr 26, 2022
Demo of patching a python context manager

patch-demo-20211203 demo of patching a python context manager poetry install poetry run python -m my_great_app to run the code poetry run pytest to te

Brad Smith 1 Feb 9, 2022
Tiny demo site for exploring SameSite=Lax

samesite-lax-demo Background on my blog: Exploring the SameSite cookie attribute for preventing CSRF This repo holds some tools for exploring the impl

Simon Willison 6 Nov 10, 2021
An extended version of the hotkeys demo code using action classes

An extended version of the hotkeys application using action classes. In adafruit's Hotkeys code, a macro is using a series of integers, assumed to be

Neradoc 5 May 1, 2022
A demo of a data science project using Kedro

iris Overview This is your new Kedro project, which was generated using Kedro 0.17.4. Take a look at the Kedro documentation to get started. Rules and

Khuyen Tran 14 Oct 14, 2022
A demo Piccolo app - a movie database!

PyMDb Welcome to the Python Movie Database! Built using Piccolo, Piccolo Admin, and FastAPI. Created for a presentation given at PyData Global 2021. R

null 11 Oct 16, 2022
Serverless demo showing users how they can capture (and obfuscate) their Lambda payloads in Datadog APM

Serverless-capture-lambda-payload-demo Serverless demo showing users how they can capture (and obfuscate) their Lambda payloads in Datadog APM This wi

Datadog, Inc. 1 Nov 2, 2021
Demo content - Automate your automation!

Automate-AAP2 Demo Content - Automate your automation! A fully automated Ansible Automation Platform. Context Installing and configuring Ansible Autom

null 0 Oct 27, 2022
Repo to demo translating colab/jupyter notebook to streamlit webapp

Repo to demo translating colab/jupyter notebook to streamlit webapp

Marisa Smith 2 Feb 2, 2022
Demo of using DataLoader to prevent out of memory

Demo of using DataLoader to prevent out of memory

null 3 Jun 25, 2022
Sample microservices application demo

Development mode docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d or export COMPOSE_FILE='docker-compose.yml:docker-compose.dev.ym

Konstantinos Bairaktaris 1 Nov 14, 2021
Demo of connecting Rasa with Zalo

Demo of connecting Rasa with Zalo

null 6 Jul 25, 2022
Demo repository for Saltconf21 talk - Testing strategies for Salt states

Saltconf21 testing strategies Demonstration repository for my Saltconf21 talk "Strategies for testing Salt states" Talk recording Slides and demos Get

Barney Sowood 3 Mar 31, 2022
Demo code for "Logs in distributed systems" webinar

Hexlet Logs Demo Пререквизиты docker-compose python3 Учетка в DataDog Базовое понимание, что такое логи (можно почитать гайд

Anton Markelov 1 Dec 1, 2021
A webdav demo using a virtual filesystem that serves a random status of whether a cat in a box is dead or alive.

A webdav demo using a virtual filesystem that serves a random status of whether a cat in a box is dead or alive.

Marshall Conover 2 Jan 12, 2022
Laurence Billingham 1 Feb 16, 2022
Todos os exercícios do Curso de Python, do canal Curso em Vídeo, resolvidos em Python, Javascript, Java, C++, C# e mais...

Exercícios - CeV Oferecido por Linguagens utilizadas atualmente O que vai encontrar aqui? ?? Esse repositório é dedicado a armazenar todos os enunciad

Coding in Community 43 Nov 10, 2022
PyDy, short for Python Dynamics, is a tool kit written in the Python

PyDy, short for Python Dynamics, is a tool kit written in the Python programming language that utilizes an array of scientific programs to enable the study of multibody dynamics. The goal is to have a modular framework and eventually a physics abstraction layer which utilizes a variety of backends that can provide the user with their desired workflow

PyDy 307 Jan 1, 2023
A Python script made for the Python Discord Pixels event.

Python Discord Pixels A Python script made for the Python Discord Pixels event. Usage Create an image.png RGBA image with your pattern. Transparent pi

Stanisław Jelnicki 4 Mar 23, 2022