A simple Neural Style Transfer webapp implemented in NextJS.
Porting from obsolete py2.7 https://github.com/jcjohnson/neural-style into https://www.digitalocean.com/community/tutorials/how-to-perform-neural-style-transfer-with-python-3-and-pytorch .
The name has been borrowed from folk songs and from this: https://github.com/SergeyMorugin/ostagram https://ostagram.me/
Work in progress, not yet released.
To deploy this project to Gitpod, tap this button:
mkdir -pv ~/vcs && \
sudo apt install python3.9-dev ccache ninja-build llvm-amdgpu4.3.1 rocrand4.3.1 rocblas4.3.1 hip-rocclr4.3.1 hsa-rocr-dev4.3.1 \
rocm-dbgapi4.3.1 rocm-debug-agent4.3.1 rocm-gdb4.3.1 comgr4.3.1 hsakmt-roct4.3.1 rocminfo4.3.1 hsakmt-roct-dev4.3.1 \
hip-base4.3.1 hip-doc4.3.1 hip-rocclr4.3.1 hip-samples4.3.1 rocm-dev4.3.1 hsa-rocr-dev4.3.1 rocm-opencl4.3.1 \
rocprofiler-dev4.3.1 rocm-opencl-dev4.3.1 rocm-clang-ocl4.3.1 rocm-utils4.3.1 comgr4.3.1 rocm-device-libs4.3.1 \
rocm-smi-lib4.3.1 roctracer-dev4.3.1 openmp-extras4.3.1 rocm-cmake4.3.1 hsa-amd-aqlprofile4.3.1 rocm-device-libs4.3.1 \
rocm-dev4.3.1 rocm-cmake4.3.1 miopen-hip4.3.1 hipfft4.3.1 hipsparse4.3.1 rocprim4.3.1 hipcub4.3.1 rocthrust4.3.1 \
rccl4.3.1 rocminfo4.3.1 && \
virtualenv --python=python3.9 ~/vcs/ostagramjs_venv3.9 && \
. ~/vcs/ostagramjs_venv3.9/bin/activate && \
git clone --recursive git@github.com:pytorch/pytorch.git && cd pytorch && python tools/amd_build/build_amd.py
pip install -r requirements.txt
# This creates dist/*.whl
rocrand_DIR=/opt/rocm/rocclr/lib/cmake/rocrand ROCclr_DIR=/opt/rocm/rocclr/lib/cmake/rocclr PYTORCH_ROCM_ARCH=gfx900 \
hip_DIR=/opt/rocm/hip/cmake/ USE_NVCC=OFF BUILD_CAFFE2_OPS=0 PATH=/usr/lib/ccache/:$PATH USE_CUDA=OFF USE_ROCM=ON DEBUG=ON python setup.py bdist_wheel
pip install dist/*.whl
# Now you can use PyTorch as usual and when you say:
# a = torch.randn(5, 5, device="cuda"),
# it'll create a tensor on the (AMD) GPU.
# Credits: http://lernapparat.de/pytorch-rocm/This is a Next.js project bootstrapped with create-next-app.
First, run the development server:
npm run dev
# or
yarn devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying pages/index.js. The page auto-updates as you edit the file.
API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.js.
The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.