Git Product home page Git Product logo

Comments (4)

hamhanry avatar hamhanry commented on June 23, 2024 2

Hi @davidzhangyuanhan ,
thanks for your sharing research to the community.
could you share more the parameter you use during training or any undescribed in the paper?
however, the training results i tried is still cant compared to the result in your paper.
as for now, i found still so many False Positives.
Thanks

from celeba-spoof.

Coderx7 avatar Coderx7 commented on June 23, 2024

@davidzhangyuanhan I'd appreciate any feedback on this.

from celeba-spoof.

ZhangYuanhan-AI avatar ZhangYuanhan-AI commented on June 23, 2024

Because of the rule of the company, I can't share the training script recently. But I can explain any training details here if you ask.

from celeba-spoof.

ZhangYuanhan-AI avatar ZhangYuanhan-AI commented on June 23, 2024

Here, we share part of our data loading pipeline code:

%%%%Transform%%%%%
        self.transform_ColorJitter= transforms.Compose([
            transforms.Resize((self.new_width, self.new_height)),
            transforms.ColorJitter(saturation = 1),
            transforms.ToTensor(),
            transforms.Normalize(mean = (0.5, 0.5, 0.5), std = (0.5, 0.5, 0.5))
           ])

  
def __getitem__(self, idx):
        filename =  self.metas[idx][0]
        cls = self.metas[idx][1]

        img = cv2_loader(filename)
        real_h,real_w,c = img.shape
        
        #Load bounding box
        assert os.path.exists(filename[:-4] + '_BB.txt'),'path not exists' + filename
   
        with open(filename[:-4] + '_BB.txt','r') as f:
            material = f.readline()
        try:
            x,y,w,h,score = material.strip().split(' ')
        except:
            print('[Rank' + str(self.rank) + ']' + filename)

        try:
            w = int(float(w))
            h = int(float(h))
            x = int(float(x))
            y = int(float(y))
            w = int(w*(real_w / 224))
            h = int(h*(real_h / 224))
            x = int(x*(real_w / 224))
            y = int(y*(real_h / 224))
            
            #Crop image
            if y < 0:
                y1 = 0
            else:
                y1 = y

            if x < 0:
                x1 = 0
            else:
                x1 = x

            if y1 + h > real_h:
                y2 = real_h
            else:
                y2 = y + h

            if x1 + w > real_w:
                x2 = real_w
            else:
                x2 =  x + w
            img = img[y1:y2,x1:x2,:]
                

        assert img.shape[0] != 0 and img.shape[1] != 0,'img_path:' + filename + ' idx:' + str(idx)
        img = Image.fromarray(cv2.cvtColor(img,cv2.COLOR_BGR2RGB)) 
        img = self.transform_ColorJitter(img)
        assert img.shape[0] == 3,filename 
        return img, cls   

from celeba-spoof.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.