From 6d81fe4431099b4f2725309560a143e3257addcb Mon Sep 17 00:00:00 2001 From: My12123 <49092250+My12123@users.noreply.github.com> Date: Mon, 24 Jul 2023 11:20:55 +0300 Subject: [PATCH 01/14] Installation and launch in an Anaconda environment --- Installer for Windows CPU.bat | 10 ++++++++++ Installer for Windows CUDA.bat | 10 ++++++++++ Open Prompt.bat | 6 ++++++ 3 files changed, 26 insertions(+) create mode 100644 Installer for Windows CPU.bat create mode 100644 Installer for Windows CUDA.bat create mode 100644 Open Prompt.bat diff --git a/Installer for Windows CPU.bat b/Installer for Windows CPU.bat new file mode 100644 index 00000000..aceed009 --- /dev/null +++ b/Installer for Windows CPU.bat @@ -0,0 +1,10 @@ +@rem The disk where the anaconda is installed +@rem Change the path to the activate.bat file +F: +call F:\1\Scripts\activate.bat +conda create -n manga-image-translator python=3.10 +conda activate manga-image-translator +pip3 install torch torchvision torchaudio +pip install -r requirements.txt +conda install -c conda-forge pydensecrf +pause diff --git a/Installer for Windows CUDA.bat b/Installer for Windows CUDA.bat new file mode 100644 index 00000000..0fbedd70 --- /dev/null +++ b/Installer for Windows CUDA.bat @@ -0,0 +1,10 @@ +@rem The disk where the anaconda is installed +@rem Change the path to the activate.bat file +F: +call F:\1\Scripts\activate.bat +conda create -n manga-image-translator python=3.10 +conda activate manga-image-translator +pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 +pip install -r requirements.txt +conda install -c conda-forge pydensecrf +pause diff --git a/Open Prompt.bat b/Open Prompt.bat new file mode 100644 index 00000000..9f5f4cc0 --- /dev/null +++ b/Open Prompt.bat @@ -0,0 +1,6 @@ +@rem The disk where the anaconda is installed +@rem Change the path to the activate.bat file +F: +call F:\1\Scripts\activate.bat +call cmd +pause \ No newline at end of file From c31a116a4fd27721df9b838104e269fffbafe84e Mon Sep 17 00:00:00 2001 From: My12123 <49092250+My12123@users.noreply.github.com> Date: Mon, 24 Jul 2023 11:25:30 +0300 Subject: [PATCH 02/14] Update Installer for Windows CUDA.bat --- Installer for Windows CUDA.bat | 1 - 1 file changed, 1 deletion(-) diff --git a/Installer for Windows CUDA.bat b/Installer for Windows CUDA.bat index 0fbedd70..ea7cc665 100644 --- a/Installer for Windows CUDA.bat +++ b/Installer for Windows CUDA.bat @@ -7,4 +7,3 @@ conda activate manga-image-translator pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 pip install -r requirements.txt conda install -c conda-forge pydensecrf -pause From 54d819ae7fa5932df74e53ce0916777bc826234d Mon Sep 17 00:00:00 2001 From: My12123 <49092250+My12123@users.noreply.github.com> Date: Mon, 24 Jul 2023 11:25:47 +0300 Subject: [PATCH 03/14] Update Installer for Windows CPU.bat --- Installer for Windows CPU.bat | 1 - 1 file changed, 1 deletion(-) diff --git a/Installer for Windows CPU.bat b/Installer for Windows CPU.bat index aceed009..3123596b 100644 --- a/Installer for Windows CPU.bat +++ b/Installer for Windows CPU.bat @@ -7,4 +7,3 @@ conda activate manga-image-translator pip3 install torch torchvision torchaudio pip install -r requirements.txt conda install -c conda-forge pydensecrf -pause From bd6ca3e873cc1df3f5d31a8ca3c9c132d6a205c8 Mon Sep 17 00:00:00 2001 From: My12123 <49092250+My12123@users.noreply.github.com> Date: Mon, 24 Jul 2023 11:29:02 +0300 Subject: [PATCH 04/14] Update Open Prompt.bat --- Open Prompt.bat | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Open Prompt.bat b/Open Prompt.bat index 9f5f4cc0..30e6bff6 100644 --- a/Open Prompt.bat +++ b/Open Prompt.bat @@ -2,5 +2,6 @@ @rem Change the path to the activate.bat file F: call F:\1\Scripts\activate.bat +conda activate manga-image-translator call cmd -pause \ No newline at end of file +pause From d1a11dd679e7eddcce495acbd5484ae382b85703 Mon Sep 17 00:00:00 2001 From: My12123 <49092250+My12123@users.noreply.github.com> Date: Mon, 24 Jul 2023 11:29:48 +0300 Subject: [PATCH 05/14] Update Open Prompt.bat --- Open Prompt.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Open Prompt.bat b/Open Prompt.bat index 30e6bff6..cf6d5684 100644 --- a/Open Prompt.bat +++ b/Open Prompt.bat @@ -2,6 +2,6 @@ @rem Change the path to the activate.bat file F: call F:\1\Scripts\activate.bat -conda activate manga-image-translator +call conda activate manga-image-translator call cmd pause From 9db3073f98279b86377e5a1de9907455996dde11 Mon Sep 17 00:00:00 2001 From: My12123 <49092250+My12123@users.noreply.github.com> Date: Mon, 24 Jul 2023 11:30:43 +0300 Subject: [PATCH 06/14] Update Open Prompt.bat --- Open Prompt.bat | 1 - 1 file changed, 1 deletion(-) diff --git a/Open Prompt.bat b/Open Prompt.bat index cf6d5684..c9e5fac1 100644 --- a/Open Prompt.bat +++ b/Open Prompt.bat @@ -4,4 +4,3 @@ F: call F:\1\Scripts\activate.bat call conda activate manga-image-translator call cmd -pause From e6dc6907b7279bfba08cecfe9d6193f24d579ae3 Mon Sep 17 00:00:00 2001 From: My12123 <49092250+My12123@users.noreply.github.com> Date: Tue, 25 Jul 2023 19:44:56 +0300 Subject: [PATCH 07/14] Update Installer for Windows CPU.bat --- Installer for Windows CPU.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Installer for Windows CPU.bat b/Installer for Windows CPU.bat index 3123596b..2bf92dae 100644 --- a/Installer for Windows CPU.bat +++ b/Installer for Windows CPU.bat @@ -2,8 +2,8 @@ @rem Change the path to the activate.bat file F: call F:\1\Scripts\activate.bat -conda create -n manga-image-translator python=3.10 +conda create -n manga-image-translator python=3.10 -y conda activate manga-image-translator pip3 install torch torchvision torchaudio pip install -r requirements.txt -conda install -c conda-forge pydensecrf +conda install -c conda-forge pydensecrf -y From a74c6687d97102315df5ec66d95c7bfd7c9c5361 Mon Sep 17 00:00:00 2001 From: My12123 <49092250+My12123@users.noreply.github.com> Date: Tue, 25 Jul 2023 19:45:16 +0300 Subject: [PATCH 08/14] Update Installer for Windows CUDA.bat --- Installer for Windows CUDA.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Installer for Windows CUDA.bat b/Installer for Windows CUDA.bat index ea7cc665..0120c2b0 100644 --- a/Installer for Windows CUDA.bat +++ b/Installer for Windows CUDA.bat @@ -2,8 +2,8 @@ @rem Change the path to the activate.bat file F: call F:\1\Scripts\activate.bat -conda create -n manga-image-translator python=3.10 +conda create -n manga-image-translator python=3.10 -y conda activate manga-image-translator pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 pip install -r requirements.txt -conda install -c conda-forge pydensecrf +conda install -c conda-forge pydensecrf -y From 4c4071d3a89d72ce25d9c93a55d20e32e45d6223 Mon Sep 17 00:00:00 2001 From: My12123 <49092250+My12123@users.noreply.github.com> Date: Tue, 1 Aug 2023 21:12:43 +0300 Subject: [PATCH 09/14] Update README.md https://cotrans.touhou.ai/ --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 21801b2c..de904cbd 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ GPU server is not cheap, please consider to donate to us. ## Online Demo -Official Demo (by zyddnys): \ +Official Demo (by zyddnys): Browser Userscript (by QiroNT): - Note this may not work sometimes due to stupid google gcp kept restarting my instance. From 8e4f47af632019fcc14413b973b907816a2553b9 Mon Sep 17 00:00:00 2001 From: My12123 <49092250+My12123@users.noreply.github.com> Date: Fri, 8 Sep 2023 20:54:52 +0300 Subject: [PATCH 10/14] Update README_CN.md https://cotrans.touhou.ai/ --- README_CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_CN.md b/README_CN.md index 789eb394..9a86e093 100644 --- a/README_CN.md +++ b/README_CN.md @@ -22,7 +22,7 @@ ## 在线版 -官方演示站 (由 zyddnys 维护): \ +官方演示站 (由 zyddnys 维护): \ 镜像站 (由 Eidenz 维护): \ 浏览器脚本 (由 QiroNT 维护): From d46c17beedc4dfdee9530e6230336ef9517c1988 Mon Sep 17 00:00:00 2001 From: My12123 <49092250+My12123@users.noreply.github.com> Date: Tue, 14 Nov 2023 03:10:50 +0300 Subject: [PATCH 11/14] Create bandit.yml --- .github/workflows/bandit.yml | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/bandit.yml diff --git a/.github/workflows/bandit.yml b/.github/workflows/bandit.yml new file mode 100644 index 00000000..4d09432d --- /dev/null +++ b/.github/workflows/bandit.yml @@ -0,0 +1,52 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# Bandit is a security linter designed to find common security issues in Python code. +# This action will run Bandit on your codebase. +# The results of the scan will be found under the Security tab of your repository. + +# https://github.com/marketplace/actions/bandit-scan is ISC licensed, by abirismyname +# https://pypi.org/project/bandit/ is Apache v2.0 licensed, by PyCQA + +name: Bandit +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + schedule: + - cron: '34 15 * * 4' + +jobs: + bandit: + permissions: + contents: read # for actions/checkout to fetch code + security-events: write # for github/codeql-action/upload-sarif to upload SARIF results + actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Bandit Scan + uses: shundor/python-bandit-scan@9cc5aa4a006482b8a7f91134412df6772dbda22c + with: # optional arguments + # exit with 0, even with results found + exit_zero: true # optional, default is DEFAULT + # Github token of the repository (automatically created by Github) + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information. + # File or directory to run bandit on + # path: # optional, default is . + # Report only issues of a given severity level or higher. Can be LOW, MEDIUM or HIGH. Default is UNDEFINED (everything) + # level: # optional, default is UNDEFINED + # Report only issues of a given confidence level or higher. Can be LOW, MEDIUM or HIGH. Default is UNDEFINED (everything) + # confidence: # optional, default is UNDEFINED + # comma-separated list of paths (glob patterns supported) to exclude from scan (note that these are in addition to the excluded paths provided in the config file) (default: .svn,CVS,.bzr,.hg,.git,__pycache__,.tox,.eggs,*.egg) + # excluded_paths: # optional, default is DEFAULT + # comma-separated list of test IDs to skip + # skips: # optional, default is DEFAULT + # path to a .bandit file that supplies command line arguments + # ini_path: # optional, default is DEFAULT + From 8b8d2641204ade19d6bff67812115592ca6b4b61 Mon Sep 17 00:00:00 2001 From: My12123 <49092250+My12123@users.noreply.github.com> Date: Mon, 20 Nov 2023 16:05:46 +0300 Subject: [PATCH 12/14] Update Installer for Windows CUDA.bat --- Installer for Windows CUDA.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installer for Windows CUDA.bat b/Installer for Windows CUDA.bat index 0120c2b0..198ffe37 100644 --- a/Installer for Windows CUDA.bat +++ b/Installer for Windows CUDA.bat @@ -4,6 +4,6 @@ F: call F:\1\Scripts\activate.bat conda create -n manga-image-translator python=3.10 -y conda activate manga-image-translator -pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 +pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 pip install -r requirements.txt conda install -c conda-forge pydensecrf -y From f7151442f1874fe7809268b88418b377d3dc1dca Mon Sep 17 00:00:00 2001 From: My12123 <49092250+My12123@users.noreply.github.com> Date: Tue, 21 Nov 2023 11:17:52 +0300 Subject: [PATCH 13/14] Create codeql.yml --- .github/workflows/codeql.yml | 82 ++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..6195484a --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,82 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + schedule: + - cron: '30 6 * * 2' + +jobs: + analyze: + name: Analyze + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners + # Consider using larger runners for possible analysis time improvements. + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'c-cpp', 'python' ] + # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] + # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" From cc5f46a2c2eeaaa1ee8193d11fda63c876e98b4f Mon Sep 17 00:00:00 2001 From: My12123 <49092250+My12123@users.noreply.github.com> Date: Tue, 21 Nov 2023 11:26:21 +0300 Subject: [PATCH 14/14] Update codeql.yml --- .github/workflows/codeql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6195484a..de05cdea 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -38,7 +38,7 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'c-cpp', 'python' ] + language: [ 'python' ] # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both