Commit Graph

9695 Commits

Author SHA1 Message Date
evazion
52ff12dffb dtext: fix wiki links not showing tag type for empty tags. 2022-07-05 15:19:41 -05:00
evazion
ba36e48bff jobs: fix no method error in /jobs.
Broken by the upgrade to good_job 3.0.
2022-07-05 00:54:38 -05:00
evazion
9000fa63bc related tags: fix AI tags not showing rating tags.
* Fix the suggested tags list in the related tags box not showing rating tags.
* Fix the suggested tags list showing tags that have been aliased to another tag.
2022-07-02 19:05:12 -05:00
evazion
6386962357 Fix #5225: PG::AmbiguousColumn: ERROR: column reference "bit_prefs" is ambiguous 2022-07-02 17:37:22 -05:00
evazion
0d953e2492 related tags: add AI tags to related tags section.
Add a Suggested tags list to the Related Tags box. The suggested tags
are just the AI tags for the post.

Suggested tags are currently hidden in CSS for beta testing. Use custom
CSS to unhide them.
2022-07-02 05:29:59 -05:00
evazion
67798c9ece Fix #5221: Trying to upload an unsupported url shows ai tags error. 2022-07-01 18:13:36 -05:00
evazion
d1ace32c40 bigquery: exclude large tables from nightly BigQuery dumps.
Exclude the posts, post_votes, favorites, media_assets, and ai_tags
tables from the BigQuery dumps. These usually take too long to complete
and also consume huge amounts of memory in the background workers.
2022-06-30 21:42:30 -05:00
evazion
a9fe73a483 ai tags: save ai tags on upload.
Save the AI tags when a media asset is uploaded.
2022-06-28 03:12:46 -05:00
evazion
c0c435da21 commentaries: remove unused search page template.
Remove file forgotten in 907194fc6.
2022-06-27 19:40:09 -05:00
evazion
2c45eb0aad ai tags: don't show add/remove tag buttons on unposted assets.
It's not possible to add or remove tags on unposted media assets, so
don't show the buttons in this case.
2022-06-27 19:37:03 -05:00
evazion
c4498f9be7 ai tags: allow searching for ai:monochrome,0%
Allow searching for e.g. `ai:monochrome,0%` to find posts where the AI has 0% confidence
the post should be tagged monochrome.

This is useful for finding mistagged posts. You can search `monochrome ai:monochrome,0%`
to find posts that are potentially mistagged as monochrome, that is, posts that are
tagged monochrome but where the AI has 0% confidence that it should be tagged monochrome.

Not all cases will be mistags. The majority will be cases where the AI failed to identify
the tag. This is also useful for studying the AI's failures.
2022-06-27 19:36:15 -05:00
evazion
ab7462a42d discord: fixup /tagme command.
Add code left out of 0435967f.
2022-06-27 03:57:09 -05:00
evazion
6a08c57cec ai tags: fix N+1 query issue. 2022-06-27 02:37:49 -05:00
evazion
a2d8d19625 Fix #5215: Using the full rating name in /ai_tags shows no results 2022-06-27 01:56:45 -05:00
evazion
04359d67f4 discord: update /tagme command to use new autotagger service. 2022-06-27 01:40:44 -05:00
evazion
ee57ada33b ai tags: add autotagger API client.
Add API client for https://github.com/danbooru/autotagger service.
2022-06-27 01:09:14 -05:00
evazion
c199c7eab7 ai tags: adjust thumbnail layout. 2022-06-26 20:37:35 -05:00
evazion
6f24db92e5 ai tags: make ai tags accessible in api via includes.
Make these things work:

* https://danbooru.donmai.us/posts.json?only=ai_tags
* https://danbooru.donmai.us/media_assets.json?only=ai_tags
* https://danbooru.donmai.us/ai_tags.json?only=media_asset,post,tag
2022-06-26 20:37:35 -05:00
evazion
efe0e8a6bd ai tags: default to showing only posts, not media assets.
Change the /ai_tags page to show only posts by default, not both posts
and unposted media assets mixed together. Showing media assets tended to
confuse users about why they couldn't add tags to these images. It also
distracted from the page's primary use case, which is gardening posts.
2022-06-26 20:37:35 -05:00
evazion
8f2774075a ai tags: disable "Add" button if user doesn't have permission to edit the post.
Disable the "Add" button on the /ai_tags page when the current user doesn't have
permission to edit the post, for example if they're not logged in.
2022-06-26 20:37:35 -05:00
evazion
f35bc60e51 posts: add hidden 540px thumbnail size option.
Add a hidden option for 540px size thumbnails. This option currently
isn't listed in the thumbnail size menu, but it can be enabled with an
URL param: https://danbooru.donmai.us/posts?size=540.
2022-06-26 20:37:32 -05:00
evazion
5795a651f1 ai tags: fix add/remove button size.
Fix it so the Add/Remove button stays the same size and doesn't shift
the layout when transitioning between states.
2022-06-26 01:29:42 -05:00
evazion
54e2bbd86b posts: fix has_tag? method.
Fix a bug where `Post#has_tag?` would return false for tags that
contained colons. This caused the /ai_tags page to incorrectly say
certain tags weren't present on the post.
2022-06-26 01:07:12 -05:00
evazion
97db0e6db3 ai tags: respect the user's posts-per-page setting on the /ai_tags page. 2022-06-26 00:44:01 -05:00
evazion
e5879f0def ai tags: add buttons for quickly adding and removing tags on the /ai_tags page.
Add "Add" and "Remove" buttons beneath thumbnails on the /ai_tags page.
These let you add the tag to the post if it's correct, or remove it if
it's wrong.
2022-06-26 00:43:57 -05:00
evazion
7b1f6e42c1 posts: add "Absurd" size option to thumbnail size menu.
Add option for "Absurd" (720px) size thumbnails to the thumbnail size
menu. 720px size thumbnails require .webp support so they won't work in
older browsers.
2022-06-25 21:53:27 -05:00
evazion
c059b4a39a ai tags: add ability to filter by confidence in post searches.
Allow searching for e.g. `ai:solo,>=90%` to to find posts that have the
solo tag with >=90% confidence. The default confidence level is 50%. The
delimiter is a comma because it's one of the few characters not allowed
in tag names.
2022-06-25 21:51:48 -05:00
evazion
97ba21e615 ai tags: add ability to order /ai_tags page by confidence. 2022-06-25 21:51:14 -05:00
evazion
d3267a5ffa user upgrades: fix button when upgrades are disabled. 2022-06-24 15:14:18 -05:00
evazion
bec9e5a5d9 ai tags: fix broken "Unposted" link on /ai_tags page. 2022-06-24 08:42:40 -05:00
evazion
de261bc321 ai tags: enable filtering by unposted media assets.
Enabled filtering by posted media assets on the /ai_tags page. This was
disabled in development because it was too slow, but seems to be fine in
production.
2022-06-24 08:35:39 -05:00
evazion
2adffb4f92 ai tags: fix broken links to unposted media assets.
Fix thumbnails on the /ai_tags page not linking to media assets correctly.
2022-06-24 08:33:07 -05:00
evazion
1aeb52186e Add AI tag model and UI.
Add a database model for storing AI-predicted tags, and add a UI for browsing and searching these tags.

AI tags are generated by the Danbooru Autotagger (https://github.com/danbooru/autotagger). See that
repo for details about the model.

The database schema is `ai_tags (media_asset_id integer, tag_id integer, score smallint)`. This is
designed to be as space-efficient as possible, since in production we have over 300 million
AI-generated tags (6 million images and 50 tags per post). This amounts to over 10GB in size, plus
indexes.

You can search for AI tags using e.g. `ai:scenery`. You can do `ai:scenery -scenery` to find posts
where the scenery tag is potentially missing, or `scenery -ai:scenery` to find posts that are
potentially mistagged (or more likely where the AI missed the tag).

You can browse AI tags at https://danbooru.donmai.us/ai_tags. On this page you can filter by
confidence level. You can also search unposted media assets by AI tag.

To generate tags, use the `autotag` script from the Autotagger repo, something like this:

  docker run --rm -v ~/danbooru/public/data/360x360:/images ghcr.io/danbooru/autotagger ./autotag -c -f /images | gzip > tags.csv.gz

To import tags, use the fix script in script/fixes/. Expect a Danbooru-size dataset to take
hours to days to generate tags, then 20-30 minutes to import. Currently this all has to be done by hand.
2022-06-24 04:54:26 -05:00
evazion
ae9495ec7c discord: allow only rating:g posts in SFW channels. 2022-06-08 17:36:49 -05:00
evazion
06f75c39a1 footer: remove app name and 2257 link. 2022-06-06 01:00:02 -05:00
evazion
4364516f2b posts: change safe mode to only allow rating:g posts. 2022-06-06 00:56:52 -05:00
evazion
ca289d869c Merge pull request #5199 from NamelessContributor/patch-1
Add back social icons to site footer.
2022-06-05 15:56:53 -05:00
evazion
7149845677 Merge pull request #5202 from nonamethanks/fix-nicoseiga-oekaki-bad-tag
Nicoseiga: normalize oekaki links
2022-06-05 15:56:37 -05:00
evazion
821b97b4e2 Merge pull request #5201 from nonamethanks/fix-deviantart
Deviantart: fix regression in 3a0a32b98a
2022-06-05 15:56:06 -05:00
evazion
acc4a21687 posts: allow admins to approve the same post twice.
This is so admins can overrule flags and always have the final say in whether a
post is approved, even in the event of coordinated or sockpuppet flagging.

Fixes #4980: Way to mark flags as invalid for admins
2022-06-05 15:51:58 -05:00
evazion
907194fc6f commentaries: move search form to /artist_commentaries page.
* Move the commentary search form to the /artist_commentaries page.
* Add Order field for changing the sort order.
2022-06-05 14:28:44 -05:00
evazion
05df3a194c posts: add more free metatags.
The following metatags no longer count against the tag search limit:

* is
* id
* date
* age
* filesize
* filetype
* parent
* child
* md5
* width
* height
* duration
* mpixels
* ratio
* score
* upvotes
* downvotes
* favcount
* embedded
* tagcount
* pixiv_id
* pixiv

These are mostly metatags that have to do with properties of the post
itself. Other metatags still count because they involve things like
subqueries or joins, or they're more tag-like in function.
2022-06-05 14:28:44 -05:00
nonamethanks
e7584c7e0a Nicoseiga: normalize oekaki links 2022-06-04 22:57:54 +02:00
nonamethanks
2fd8e9bc14 Deviantart: fix regression in 3a0a32b98a 2022-06-04 20:26:14 +02:00
NamelessContributor
6e8b43bd69 Add back social icons to site footer.
Revert 1720246cb9 and f668cfdbac
2022-06-03 16:30:38 +02:00
evazion
ea92cbff4e user upgrades: update upgrade page text. 2022-06-02 14:40:42 -05:00
evazion
fec92d765a users: change default blacklist to furry -rating:g. 2022-06-02 00:06:34 -05:00
evazion
572c58d115 Merge pull request #5187 from Hyozen1/patch-1
Allow background-clip and -webkit-background-clip properties in notes
2022-06-01 19:26:06 -05:00
evazion
cc2285ed6f Merge pull request #5188 from nonamethanks/fix-deviantart
Fix deviantart strategy to get biggest available size
2022-06-01 18:39:43 -05:00
evazion
434e44ba8b Merge pull request #5197 from nonamethanks/fix-bur-links
BURs: don't allow edits to approved scripts
2022-06-01 18:37:09 -05:00