Spaces:
Sleeping
Sleeping
Commit History
-
allow origins on web app deployment urls
Ruzzel Mendoza682dadb
-
whash, phash, and dhash weight tuning
Ruzzel Mendoza7c8d720
-
fallback legacy
Ruzzel Mendoza18f4339 -
fix
Ruzzel Mendoza28a415d -
asd
Ruzzel Mendoza5d0b1a5
-
Fix transform_consistency default + expose agreement counts
Ruzzel MendozaReporting bug (from review of the production washed-out response): compute_transform_consistency returned the neutral (1.0, None) default even when there were NO agreeing block pairs, so every unrelated row showed a misleadingly perfect consistency of 1.0 next to a raw/calibrated score of 0. That is the root of the reported page of constants: raw_similarity 0 + calibrated_confidence 0 + transform_consistency 1.0 + content_blocks_used 5. Fix (reporting-only; zero score impact): - compute_transform_consistency([]) now returns (0.0, None). Only a non-empty set of agreements that is entirely geometrically uninformative (e.g. center-center) keeps the neutral (1.0, None); the MIN_CONSENSUS_BLOCKS cap continues to guard against single coincidental matches. - Algebra unchanged: with no block agreements the block contribution is already 0, so the consistency multiplier (0 or 1) does not change the score. Expose agreement counts on every match object and the compare payload: - transfor…6f114bb
-
Add pytest to requirements (rewrite as UTF-8) + RESPONSE_STRUCTURE_AUDIT.md - requirements.txt: rewrite the UTF-16 pip-freeze as clean UTF-8 (content unchanged) and add pytest==9.1.1 - RESPONSE_STRUCTURE_AUDIT.md: frontend migration reference documenting every change to POST /plagiarism/check/web and POST /plagiarism/compare: additive-only field set (raw_similarity, raw_similarity_legacy [transitional], calibrated_confidence, transform_consistency, content_blocks_used, low_content_warning + compare-only calibration_loaded, background_coincidence_suppressed, dominant_transform + hashes.blocks.*.entropy), old vs new JSON examples, flagging threshold derivation (p99 rule; current degenerate-baseline value 5.0), behavior changes (top-5 ordering, best_match by calibrated_confidence)
Ruzzel Mendoza21f5be6 -
API: wire new scoring fields through /plagiarism responses - db/web/best_match and every other_matches entry now carry raw_similarity, raw_similarity_legacy, calibrated_confidence, transform_consistency, content_blocks_used, low_content_warning alongside the unchanged similarity field - best_match picked by calibrated_confidence (monotonic in raw score; tie-break semantics unchanged) - top-level low_content_warning on both endpoints (upload-side flag for /check/web, either-image flag for /compare) - hashes payload blocks now include entropy tags (additive) - drop debug print of the full artwork payload - verified end-to-end with a stubbed-services smoke test: /compare and /check/web return the documented field set
Ruzzel Mendoza2dac237 -
Phase 5: rotation-aware global pre-filter + scoring refinements - global_prefilter_distance: query phash('0') vs ALL SIX stored transform-variant phashes (6 Hamming ops, no re-hashing); scan_database skips a row only when every variant exceeds GLOBAL_PREFILTER_MAX_DISTANCE (default 28, env-overridable) - pre-filter is performance-only: never sets or influences scores of rows that pass; skip count logged - scan_database/check_distance_between_serp now return true top-5 sorted by calibrated_confidence (primary score) with the full new field set per match (was: history of interim bests) - scoring refinement for rotate-and-repost: final = 0.3*T*transform_cap + 0.7*B*block_multiplier so block geometry can no longer zero out transform evidence (pure rotations: T~65, blocks 0 -> final ~20, flagged) - background-coincidence guard: transform resemblance without ANY block corroboration is voided unless the alignment is tight (avg dist <= STRICT/2) - fixes the matching-background false positive at the global level while preserving rotation/mirror/flip detection - regression fixture verified: legacy 96.48% (old bug) vs new 0.0; sparse-art exact copy stays 100.0 (no over-suppression); real-data baseline re-verified: 78/78 unrelated pairs score 0.0, prefilter dists 18-32 vs cutoff 28 (kept: conservative, true copies at <=10) - tests 5/6/7 added: sparse-art multiplier, original-bug regression, prefilter + scan_database
Ruzzel Mendozaf83b9ab -
Phase 4: baseline calibration + calibrated_confidence - scripts/calibrate_baseline.py: offline script (not wired to API) that cross-pairs registered artworks from Supabase (or a --from-json dump) through the consensus pipeline and persists config/calibration.json - lib/phash: load_calibration()/calibrated_confidence()/plagiarism_threshold(); percentile-table interpolation with normal-CDF tails, identity fallback until calibrated; compare_hash_sets now returns calibrated_confidence + calibration_loaded - ran against live DB: 13 artworks / 78 unrelated pairs. Result: legacy scores unrelated pairs 56.7-72.3% (reproduces reported false positives); new consensus scores all 78 pairs 0.0 (0/78 block agreements; best unrelated block distance min 17.7 vs STRICT_MATCH_DISTANCE 12) - threshold: degenerate baseline (stddev 0) -> documented rule threshold = best unrelated score + 5 = 5.0; switches to p99 once the catalog yields a spread - constants revisited vs data (follow-up brief item 4): STRICT_MATCH_DISTANCE=12 supported by 17.7+ gap; MIN_BLOCK_STDDEV=5 unverifiable until DB rows carry entropy (kept); prefilter cutoff validated in Phase 5 - tests: percentile interpolation, tail extrapolation/clamping, identity fallback, threshold lookup, compare_hash_sets field presence
Ruzzel Mendoza61d2c38 -
Phase 3: transform/geometric consistency confidence multiplier - TRANSFORM_BLOCK_MAP: where each block position lands under 0/90/180/270/mirror/flip - compute_transform_consistency: agreeing block pairs vote for the transform implied by their position mapping (center matches excluded as uninformative, ambiguous pairs split votes); returns fraction of votes held by dominant transform - confidence_multiplier = consistency * evidence cap; cap ramps to 1 at MIN_CONSENSUS_BLOCKS (default 2) but never demands more agreeing blocks than the image has content blocks (sparse-art fairness) - final score = (0.3*transform + 0.7*block consensus) * multiplier; expose transform_consistency and dominant_transform in compare_hash_sets - tests: unit votes, identical=1.0 dominant '0', scrambled quadrants -> 0.5 + suppressed score, single lucky match capped at 0.5
Ruzzel Mendozaf98281a -
Phase 2: consensus-based scoring - replace single-minimum-distance logic in compare_blocks/compare_transforms with per-component best-match consensus: count pairs below tunable STRICT_MATCH_DISTANCE (default 12.0), derive similarity from (agreement ratio, avg distance of agreeing pairs) - expose agreements/agreement_ratio/content_blocks_used in results - retain old algorithm as compare_blocks_legacy/compare_transforms_legacy; compare_hash_sets now returns raw_similarity (new method) and raw_similarity_legacy (old method) side by side for transition-period validation - tests: identical -> ~100, one shared block -> legacy ~90 but consensus capped ~20, unrelated -> low
Ruzzel Mendozaf731132 -
Phase 1: entropy filtering for block matching - add block_entropy() (stddev of preprocessed grayscale block) and tunable MIN_BLOCK_STDDEV (env-overridable, default 5.0) - tag each block hash dict with its entropy score in generate_block_hashes - compare_blocks excludes pairs where either block is flat/low-detail; falls back to all blocks with low_content_warning when an image has no content - propagate content_blocks_used/low_content_warning through compare_hash_sets - legacy DB rows without entropy stay eligible (backward compat) - add pytest scaffolding and entropy-filtering tests
Ruzzel Mendoza4b85872
-
Dont scan artworks for plagiarism for removed artworks
Ruzzel Mendoza07779ba
-
removed pyinstrument
Ruzzel Mendozaef4e0ab -
add parallelization to generating hash from serp
Ruzzel Mendoza0c2a3e0
-
Added new MIME types (#3)
- Added new MIME types (91081ca98663eadd91a3a01a1d67844d4850d56b) Co-authored-by: nathaniel sto nino <Natsuna@users.noreply.huggingface.co>ea93233
-
remove jpeg and png file format restriction when classifying an image
Ruzzel Mendoza1a1b620
-
Show Multiple Matches for Plagiarized Artworks
Ruzzel MendozaModify the plagiarism detection query/algorithm to return an array of the top 3-5 matches instead of just the top 1. The API should return the image URLs and similarity percentages for each match. The frontend team will then need to map through this data to display a grid or carousel of the detected similarities.1a39441
-
change url to return the id of the artwork
Ruzzel Mendoza030a111 -
rename route name for compare_two_artsworks
Ruzzel Mendoza9beeff1 -
add route for comparing two images
Ruzzel Mendoza5315099 -
integrate database scan to upload plagiarism api
Ruzzel Mendozabfdc38e -
add the hashes to plagiarism upload response
Ruzzel Mendozaa0fc0ed -
add success response to plagiarism upload
Ruzzel Mendozaac976fc -
change plagiarism upload to return only the best match
Ruzzel Mendoza828f661 -
add asset url to db best match
Ruzzel Mendoza017dad9 -
add asset url to db best match
Ruzzel Mendoza303ba11 -
Changed PlagiarismWebResult type structure to db scan
Ruzzel Mendozaf2dc9bb -
plagiarism check route name
Ruzzel Mendoza65909f2 -
plagiarism check route name
Ruzzel Mendoza662d7e0 -
database similarity check
Ruzzel Mendoza17c6fb0
-
rework plagiarism algo to grid based hashing
Ruzzel Mendoza1998795
-
rework descriptive prompts for better art classification
Ruzzel Mendoza0f5fa48 -
add index to art classification genres
Ruzzel Mendoza9a8d35c
-
add original and unaltered phash to the return structure of web plagiarism search result
Ruzzel Mendozae3bcf7c -
rework return structure of web plagiarism search result
Ruzzel Mendoza64c549c
-
Change Plagiarism Check from a websocket into a normal API POST request
Ruzzel Mendozab35f641
-
Clean requirements for Hugging Face Space
Ruzzel Mendozab6abf66 -
docker file
Ruzzel Mendozaa55e3ef -
Clean Deployment for Hugging Face
Ruzzel Mendoza887791e