{"id":19426660,"url":"https://github.com/zetane/torch-xai","last_synced_at":"2025-07-11T08:07:18.003Z","repository":{"id":248027983,"uuid":"827552250","full_name":"zetane/torch-xai","owner":"zetane","description":"ZetaForge XAI Torch Pipeline","archived":false,"fork":false,"pushed_at":"2024-07-12T14:42:00.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-07T19:38:33.869Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zetane.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-11T22:04:21.000Z","updated_at":"2024-07-12T14:42:04.000Z","dependencies_parsed_at":"2025-01-07T19:36:38.938Z","dependency_job_id":"08e34a8d-f68d-48f7-86fb-71305b8ec537","html_url":"https://github.com/zetane/torch-xai","commit_stats":null,"previous_names":["zetane/torch-xai"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zetane%2Ftorch-xai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zetane%2Ftorch-xai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zetane%2Ftorch-xai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zetane%2Ftorch-xai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zetane","download_url":"https://codeload.github.com/zetane/torch-xai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240605840,"owners_count":19827985,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T14:08:32.230Z","updated_at":"2025-02-25T05:16:34.939Z","avatar_url":"https://github.com/zetane.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# torch-xai\n\n## ZetaForge XAI Torch Pipeline\n\n![image (32)](https://github.com/user-attachments/assets/34127c39-5e85-4d90-8c0f-99a34e119345)\n\nBlock input details:\n- test_dataset_file : zip file contaning all the images and xlsx dataframe, where image column name must be \"filename\".\n- model_process_file: pickle file containing model and the pre-process code, see the code below for how to save the model and processor.\n- model_architecture_type: three options we have \"cnn\", \"ViT\", \"SwiT\"\n- target_layer: name of the target layer on which xai will be performed.\n- saving_dir: name of the save dir.\n\nHere is the demo script for how to save model and processor.\n\n```\nimport torch\nimport torchvision.models as models\nimport torchvision.transforms as transforms\nimport pickle\n\n# Load the ResNet18 model\nmodel = models.resnet50(pretrained=True)\nmodel.eval()\n\n# Create the transform\ntransform = transforms.Compose([\n    transforms.Resize(256),\n    transforms.CenterCrop(224),\n    transforms.ToTensor(),\n    transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),\n])\n\n# Create a dictionary with the model and transform\ndata = {\n    'model': model,\n    'processor': transform\n}\n\n# Save the dictionary to a pickle file\nwith open('resnet18_model_and_transform.pkl', 'wb') as f:\n    pickle.dump(data, f)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzetane%2Ftorch-xai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzetane%2Ftorch-xai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzetane%2Ftorch-xai/lists"}