Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Database Migration for sorting images: #352

Merged
merged 40 commits into from
Jul 21, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
45c0952
Add Database Migration for sorting images:
jLeonBi May 31, 2021
2ede036
Add python scripts:
jLeonBi Jun 1, 2021
bf46a0c
Add empty jobs and associated test:
jLeonBi Jun 2, 2021
79a303c
Work on GenerateImageHash:
jLeonBi Jun 8, 2021
53b992f
Fill SimilarityIndex Job and script:
jLeonBi Jun 9, 2021
e6a1898
Change chack if hash is available
jLeonBi Jun 9, 2021
b7babf7
add install imagehash but Failed
jLeonBi Jun 15, 2021
daeb7dc
change install from imagehash to suggested one
jLeonBi Jun 15, 2021
c3a7edd
Fix worker dockerfile
mzur Jun 15, 2021
6d10209
rewrite GenerateHashValueJob:
jLeonBi Jun 15, 2021
820d235
Merge branch 'imageCompare' of https://github.com/jLeonBi/core into i…
jLeonBi Jun 15, 2021
9891b7e
rewrite generateHashValue:
jLeonBi Jun 16, 2021
f9db386
Change HashValueGenerator script:
jLeonBi Jun 16, 2021
19f6b86
work on generateHashValue job:
jLeonBi Jun 21, 2021
918f33c
Fix first time handle job:
jLeonBi Jun 21, 2021
5656448
update python scripts:
jLeonBi Jun 21, 2021
c5a955b
change output file form SamilarityIndexGenerator:
jLeonBi Jun 21, 2021
7d4aefa
add GerneatSimilarityIndex Job:
jLeonBi Jun 22, 2021
8e94659
update GenerateHashValue and GenerateSimilarityIndex:
jLeonBi Jun 24, 2021
973d06d
rewrite GenerateSimilartiyIndex:
jLeonBi Jun 24, 2021
65768e5
Add starting Jobs:
jLeonBi Jun 25, 2021
ceb76b4
apply suggested changes from mzur
jLeonBi Jun 25, 2021
2b69863
Merge branch 'master' of https://github.com/biigle/core into imageCom…
mzur Jun 28, 2021
e5fd021
Merge for starting docker and add boarder case:
jLeonBi Jun 29, 2021
1631983
Apply code readable suggestions:
jLeonBi Jun 30, 2021
af0714f
change npmrc for pushing
jLeonBi Jul 11, 2021
d871422
remove old token
jLeonBi Jul 11, 2021
2e5a4d0
add new token
jLeonBi Jul 11, 2021
85aa868
remove npmrc
jLeonBi Jul 11, 2021
2f6a01a
Delete .npmrc
jLeonBi Jul 11, 2021
48fa4ed
empty npmrc
jLeonBi Jul 11, 2021
69d71c4
remove old npmrc add new one
jLeonBi Jul 11, 2021
7da371d
Work on Frontend for Similarity Index Sorting:
jLeonBi Jul 12, 2021
3932686
remove unneccessary dd
jLeonBi Jul 12, 2021
d0a14f8
run npm run prod
jLeonBi Jul 12, 2021
bebb618
Work on similarityindex sorter:
jLeonBi Jul 14, 2021
87d1dc5
update sorting function for similarity index
jLeonBi Jul 17, 2021
b947b68
Add test for SimilarityIndexController:
jLeonBi Jul 17, 2021
90ce456
add crated for getting volume id
jLeonBi Jul 20, 2021
2e5c4d7
Finsish image compare project:
jLeonBi Jul 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@biigle:registry=https://npm.pkg.github.com
12 changes: 5 additions & 7 deletions app/Http/Controllers/Api/Volumes/SimilarityIndicesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Biigle\Http\Controllers\Api\Controller;
use Biigle\Volume;
use Biigle\MediaType;

class SimilarityIndicesController extends Controller
{
Expand All @@ -30,14 +31,11 @@ class SimilarityIndicesController extends Controller
public function index($id)
{
// should not be find or fail
$volume = Volume::findOrFail($id);
if ($volume->isImageVolume()) {
$this->authorize('access', $volume);
$volume = Volume::where('media_type_id', MediaType::imageId())->findOrFail($id);
$this->authorize('access', $volume);

return $volume->files()->pluck('similarityIndex', 'id');

return $volume->files()->pluck('similarityIndex', 'id');
}
// check right return statement
return;

}
}
2 changes: 1 addition & 1 deletion public/assets/scripts/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"/assets/scripts/main.js": "/assets/scripts/main.js?id=a711e5ebbcf73699cbac",
"/assets/scripts/main.js": "/assets/scripts/main.js?id=4026bac24d2927712fa2",
"/assets/styles/main.css": "/assets/styles/main.css?id=5e394695bd62ab9179f6"
}
26 changes: 21 additions & 5 deletions resources/assets/js/volumes/stores/sorters.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import SortComponent from '../components/sortComponent';
import VolumesApi from '../api/volumes';

let filenameSorter = {
id: 'filename',
Expand Down Expand Up @@ -84,7 +85,6 @@ let randomSorter = {
},
getSequence() {
let ids = this.shuffle(this.fileIds.slice());

return new Vue.Promise.resolve(ids);
},
handleClick() {
Expand All @@ -106,22 +106,38 @@ let similaritySorter = {
mixins: [SortComponent],
data() {
return {
fileIds: [],
indices: [],
title: 'Sort images by Similarity',
text: 'Similarity',
id: 'similarity',
cache: [],
};
},
methods: {
getSequence() {
// let ids = ;
return new Vue.Promise.resolve(this.indices);

// return new Vue.Promise.resolve(ids);
},
getSimilarityIndices() {
this.loadingSequence = true;
return VolumesApi.querySimilarityIndices({id: this.volumeId})
.then(this.parseResponse)
.then((sequence) => {
this.cache = sequence;
return sequence;
})
.finally(() => this.loadingSequence = false);
},
parseResponse(response) {
return response.data;
},
compare(a, b) {
return a - b;
},

},
created() {
this.fileIds = biigle.$require('volumes.fileIds');
this.indices = this.getSimilarityIndices();
mzur marked this conversation as resolved.
Show resolved Hide resolved
},
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function testVideoMediaType()
// what should the api return if media type ius video
$this->beGuest();
$this->get("/api/v1/volumes/{$id}/similarity-indices/")
->assertStatus(200);
->assertStatus(404);

}
}