Compare commits
No commits in common. "master" and "0.2.0" have entirely different histories.
@ -1,4 +1,4 @@
|
||||
name: release
|
||||
name: build release
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -10,10 +10,6 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
|
||||
|
||||
- name: checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
@ -23,7 +19,7 @@ jobs:
|
||||
go-version: '1.13.0'
|
||||
|
||||
- name: Build
|
||||
run: make -j $(nproc) compile VERSION=${{ steps.get_version.outputs.VERSION }}
|
||||
run: make -j $(nproc) compile VERSION=${{ github.ref }}
|
||||
|
||||
- name: create release
|
||||
id: create_release
|
||||
@ -31,8 +27,8 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ steps.get_version.outputs.VERSION }}
|
||||
release_name: Release ${{ steps.get_version.outputs.VERSION }}
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: Release ${{ github.ref }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
23
.github/workflows/build.yml
vendored
23
.github/workflows/build.yml
vendored
@ -1,23 +0,0 @@
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: '1.13.0'
|
||||
|
||||
- name: Build
|
||||
run: make -j $(nproc) compile
|
||||
|
9
Makefile
9
Makefile
@ -17,16 +17,15 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
NAME = $(shell basename $(shell readlink -e .))
|
||||
NAME = range-gen
|
||||
VERSION = dev_$(shell date +%F_%T)
|
||||
GOCMD = go
|
||||
LDFLAGS := "$(LDFLAGS) -X 'main.Version=$(VERSION)'"
|
||||
GOBUILD = $(GOCMD) build -ldflags=$(LDFLAGS)
|
||||
SRCMAIN = ./cmd/$(NAME)
|
||||
SRCDOC = ./doc
|
||||
BINDIR = bin
|
||||
BIN = $(BINDIR)/$(NAME)
|
||||
README = $(SRCDOC)/README
|
||||
README = ./doc/README
|
||||
LICENSE = LICENSE
|
||||
PREFIX = /usr
|
||||
|
||||
@ -42,8 +41,8 @@ build: prep
|
||||
$(GOBUILD) -o $(BIN) $(SRCMAIN)
|
||||
|
||||
doc: check-build
|
||||
test -d $(SRCDOC) || mkdir $(SRCDOC)
|
||||
$(BIN) --help > $(README)
|
||||
test -d ./doc || mkdir ./doc
|
||||
$(BIN) --help > ./doc/README
|
||||
|
||||
check-build:
|
||||
test -e $(BIN)
|
||||
|
50
README.md
50
README.md
@ -1,49 +1 @@
|
||||
# Range-Gen
|
||||
|
||||
[](https://github.com/GenZmeY/range-gen/actions)
|
||||
[](https://golang.org)
|
||||
[](https://www.gnu.org/licenses/gpl-3.0.en.html)
|
||||
[](https://github.com/GenZmeY/range-gen/releases)
|
||||
|
||||
*range-gen creates a list of scene ranges based on a set of frames from the video. This program is used in the [video2d-2x](https://github.com/GenZmeY/video2d-2x) project.*
|
||||
|
||||
***
|
||||
|
||||
# Build & Install
|
||||
**Note:** You can get the compiled version for your platform on the [release page](https://github.com/GenZmeY/range-gen/releases).
|
||||
|
||||
Dependencies:
|
||||
- linux distro
|
||||
- git
|
||||
- golang 1.13
|
||||
- make
|
||||
|
||||
Get the source:
|
||||
`git clone https://github.com/GenZmeY/range-gen`
|
||||
|
||||
Build:
|
||||
`cd range-gen && make`
|
||||
|
||||
Install:
|
||||
`make install`
|
||||
|
||||
**Build versions for all plaforms:**
|
||||
`make -j $(nproc) compile`
|
||||
(executables will be in `range-gen/bin` folder)
|
||||
|
||||
# Usage
|
||||
```
|
||||
Usage: range-gen [option]... <input_dir> <output_file> <threshold>
|
||||
input_dir Directory with png images
|
||||
output_file Range list file
|
||||
threshold Image similarity threshold (0-1024)
|
||||
|
||||
Options:
|
||||
-j, --jobs N Allow N jobs at once
|
||||
-n, --noise Default noise level for each range (0-3)
|
||||
-h, --help Show this page
|
||||
-v, --version Show version
|
||||
```
|
||||
|
||||
# License
|
||||
Range-gen is licensed under the [GNU GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html), but uses a [go-perceptualhash](https://github.com/dsoprea/go-perceptualhash) ([BSD 3-Clause License](https://github.com/dsoprea/go-perceptualhash/blob/master/LICENSE)) to calculate hashes of images.
|
||||
# range-gen
|
@ -167,7 +167,7 @@ func calcRanges(hashes map[string]string, Threshold int) string {
|
||||
var rangeNoise string = ""
|
||||
|
||||
if ArgDefaultNoiseLevel >= 0 {
|
||||
rangeNoise = "\t" + strconv.Itoa(ArgDefaultNoiseLevel)
|
||||
rangeNoise = "\t" + string(ArgDefaultNoiseLevel)
|
||||
}
|
||||
|
||||
names := []string{}
|
||||
|
Loading…
x
Reference in New Issue
Block a user